Displaying 1 result from an estimated 1 matches for "small_2".
Did you mean:
small_
2011 Feb 03
2
Sorting a Data Frame by hybrid string / number key
...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/Sorting-a-Data-Frame-by-hybrid-string-number-key-tp3258283p3258283.html
Sent from the R hel...