Displaying 1 result from an estimated 1 matches for "competition11".
Did you mean:
competition01
2011 Feb 03
2
Sorting a Data Frame by hybrid string / number key
...39;s StringR package to split the names into the
string and numeric sections so I could get those ordered easily enough. What
I'm struggling with is how to sort the categories (because I don't want them
in a straight alphabetic order).
library(stringr)
d <- data.frame(instance =
c("competition11","competition01","big_20","small_4","small_2","med_9"))
id <- str_extract(d$instance, "\\d{1,}$")
Any pointers would be gratefully received.
Thanks,
Alastair
--
View this message in context: http://r.789695.n4.nabble.com/Sortin...