R_order
order()は複数の列を指定できる
x <- sample(1:5, 100, rep = T) y <- sample(1:5, 100, rep = T) alp <- sample(LETTERS, 100, rep = T) x.y <- data.frame(name = alp,x = x, y = y) x.y[order(x.y$name, x.y$x, x.y$y), ]
Link: R_old_tips2(1908d)
Rの備忘録(3944d)
Last-modified: 2009-03-25 (水) 12:00:48 (5673d)