From 3a4f29a50ef6c08a35ad07e1ac15221d891bad8e Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 24 Nov 2024 22:00:12 +0100 Subject: [PATCH] shorter line --- R/data_arrange.R | 3 ++- man/data_arrange.Rd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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")