Re: [R] Re-order columns

2009-09-19 Thread John Kane
uot;, "rata", "ratb", "bata", "batb"), row.names = c("aa", "bb", "cc", "dd", "ee", "ff"), class = "data.frame") df1 (df1 <- df1[,rev(1:10)]) --- On Sat, 9/19/09, Santosh wrote: >

[R] Re-order columns

2009-09-19 Thread Santosh
Dear R'sians, Would really appreciate if you could suggest a more efficient way to order the columns of a dataset. The column names of the dataset contain indices separated by a period. Following are examples of my code and the dataset. oC <- function(tg=x2) { lth<- length(grep("T",names(t