Description Usage Arguments Value Examples
sortDF is a convenience wrapper for sorting data.frames.
1 |
data |
data.frame to sort |
decreasing |
If TRUE, will be sorted in decreasing order |
by |
Variable name to sort by. If NULL, will sort by the first column |
... |
other arguments to be passed to order |
Sorted data.frame
1 2 3 4 5 6 7 | #example_df <- data.frame(a = sample(letters[1:3], 10, replace = T),
# b = rnorm(10))
#sortDF(example_df)
#sortDF(example_df, by = "b")
#sortDF(example_df, decreasing = TRUE, by = "b")
#sortDF(example_df, by=c("a", "b"))
#sortDF(example_df, by=c("b", "a"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.