I have a data.frame, like this:
nums<-c(5,7,8,9,10,3,2,1)
text<-c("a","b","c","d","a 09","b 09","c 09","d 09")
this <- data.frame()
this <- cbind(text,nums)
"a" 5
"b" 7
"c" 8
"d" 9
"a 09" 10
"b 09" 3
"c 09" 2
"d 09" 1
a:d = data from 2010, a 09:d:09 = data from 2009.
I’d like it to be sorted first by the numeric column from greatest to least and then by the string column. The only catch is that the string column has to show the 09′ data underneath the 2010 data, like this:
"d" 9
"d 09" 1
"c" 8
"c 09" 2
"b" 7
"b 09" 3
"a" 5
"a 09" 10
The Deducer package has a nice sorting function for data.frames: