sort_df.Rd
Sort data frame
sort_df(df, by, decreasing = FALSE)
data frame
column to sort by
logical. Should sorting be decreasing?
A sorted data frame
df <- data.frame(a = c(2, 4, 3), b = c(3, 5, 1))
misc::sort_df(df, "a")
#> a b
#> 1 2 3
#> 3 3 1
#> 2 4 5
misc::sort_df(df, "b", decreasing = TRUE)
#> a b
#> 2 4 5
#> 1 2 3
#> 3 3 1