Skip to content

Commit

Permalink
better example
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 24, 2024
1 parent 27c8dfb commit e64e5ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions R/data_arrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
#' # Arrange in decreasing order
#' data_arrange(head(mtcars), "-carb")
#'
#' # arrange several variables, grouped by another one
#' data_arrange(head(mtcars), c("gear", "carb"), by = "cyl")
#' # compare: arrange variables vs. arrange variable within groups
#' set.seed(123)
#' x <- iris[sample(seq_len(nrow(iris)), 10, replace = TRUE), c("Sepal.Width", "Species")]
#' data_arrange(x, c("Sepal.Width", "Species"))
#' data_arrange(x, "Sepal.Width", by = "Species")
#'
#' # Throw an error if one of the variables specified doesn't exist
#' try(data_arrange(head(mtcars), c("gear", "foo"), safe = FALSE))
Expand Down
7 changes: 5 additions & 2 deletions man/data_arrange.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e64e5ab

Please sign in to comment.