We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It appears that sort_df() does not have an option for using variables in decreasing order, which is in sort() in base.
sort_df()
sort()
This code should do the trick.
sort_df = function (data, vars = names(data), decreasing = F) { if (length(vars) == 0 || is.null(vars)) return(data) data[do.call("order", list(what = data[, vars, drop = FALSE], decreasing = decreasing)), , drop = FALSE] }
Tested with:
sort_df(iris, "Sepal.Length") sort_df(iris, "Sepal.Length", decreasing = T)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It appears that
sort_df()
does not have an option for using variables in decreasing order, which is insort()
in base.This code should do the trick.
Tested with:
The text was updated successfully, but these errors were encountered: