diff --git a/R/data_arrange.R b/R/data_arrange.R index eee103ea3..e84314d4c 100644 --- a/R/data_arrange.R +++ b/R/data_arrange.R @@ -26,7 +26,8 @@ #' #' # 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")] +#' sample_rows <- sample(seq_len(nrow(iris)), 10, replace = TRUE) +#' x <- iris[sample_rows, c("Sepal.Width", "Species")] #' data_arrange(x, c("Sepal.Width", "Species")) #' data_arrange(x, "Sepal.Width", by = "Species") #' diff --git a/man/data_arrange.Rd b/man/data_arrange.Rd index 616f3f9fb..fc54ed29b 100644 --- a/man/data_arrange.Rd +++ b/man/data_arrange.Rd @@ -42,7 +42,8 @@ data_arrange(head(mtcars), "-carb") # 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")] +sample_rows <- sample(seq_len(nrow(iris)), 10, replace = TRUE) +x <- iris[sample_rows, c("Sepal.Width", "Species")] data_arrange(x, c("Sepal.Width", "Species")) data_arrange(x, "Sepal.Width", by = "Species")