search for: desiredorder

Displaying 1 result from an estimated 1 matches for "desiredorder".

2011 Dec 29
2
sorting a data.frame (df) by a vector (which is not contained in the df) - unexpected behaviour of match and factor
...quot;, "0.933"), class = "factor")), .Names = c("level", "prevalence", "sensitivity"), class = "data.frame", row.names = c(NA, -7L)) I'd like to order df by a vector which is NOT contained in the data.frame. Let's call this vector desiredOrder (see dump below). desiredOrder <- c("0", "1", "10", "100", "11", "110", "1010") So after sorting, the order of the level column (df$level) should be in the order of the vector desiredOrder (as well a the associated data in t...