# Arrange using several variables
data_arrange(head(mtcars), c("gear", "carb"))
# Arrange in decreasing order
data_arrange(head(mtcars), "-carb")
# Throw an error if one of the variables specified doesn't exist
try(data_arrange(head(mtcars), c("gear", "foo"), safe = FALSE))
Run the code above in your browser using DataLab