From bb6defa7c518bc45d7f9b6bb702413ee74c74ba9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 8 Sep 2024 16:52:37 +0200 Subject: [PATCH] news --- NEWS.md | 12 ++++++++++-- R/data_rename.R | 2 +- man/data_rename.Rd | 3 ++- man/text_format.Rd | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 50bb72db6..f7575f524 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,14 +1,22 @@ +# datawizard (development) + +CHANGES + +* The `pattern` argument in `data_rename()` can also be a named vector. In this + case, names are used as values for the `replacement` argument (i.e. `pattern` + can be a character vector using ` = ""`). + # datawizard 0.12.3 CHANGES * `demean()` (and `degroup()`) now also work for nested designs, if argument `nested = TRUE` and `by` specifies more than one variable (#533). - + * Vignettes are no longer provided in the package, they are now only available on the website. There is only one "Overview" vignette available in the package, it contains links to the other vignettes on the website. This is because there - are CRAN errors occurring when building vignettes on macOS and we couldn't + are CRAN errors occurring when building vignettes on macOS and we couldn't determine the cause after multiple patch releases (#534). # datawizard 0.12.2 diff --git a/R/data_rename.R b/R/data_rename.R index 7e42fb02b..8b5f5c9ca 100644 --- a/R/data_rename.R +++ b/R/data_rename.R @@ -16,7 +16,7 @@ #' string, which will be added as prefix or suffix to the column names. For #' `data_rename()`, `pattern` can also be a named vector. In this case, names #' are used as values for the `replacement` argument (i.e. `pattern` can be a -#' character vector ` = `). +#' character vector using ` = ""`). #' @param replacement Character vector. Indicates the new name of the columns #' selected in `pattern`. Can be `NULL` (in which case column are numbered #' in sequential order). If not `NULL`, `pattern` and `replacement` must be diff --git a/man/data_rename.Rd b/man/data_rename.Rd index ceff93c23..77bd95f65 100644 --- a/man/data_rename.Rd +++ b/man/data_rename.Rd @@ -49,7 +49,7 @@ are selected). For \code{data_addprefix()} or \code{data_addsuffix()}, a charact string, which will be added as prefix or suffix to the column names. For \code{data_rename()}, \code{pattern} can also be a named vector. In this case, names are used as values for the \code{replacement} argument (i.e. \code{pattern} can be a -character vector \verb{ = }).} +character vector using \verb{ = ""}).} \item{select}{Variables that will be included when performing the required tasks. Can be either @@ -139,6 +139,7 @@ head(data_rename(iris, c("Sepal.Length", "Sepal.Width"), c("length", "width"))) # use named vector to rename head(data_rename(iris, c(length = "Sepal.Length", width = "Sepal.Width"))) + # Reset names head(data_rename(iris, NULL)) diff --git a/man/text_format.Rd b/man/text_format.Rd index 9ca6c3c66..3ce77210c 100644 --- a/man/text_format.Rd +++ b/man/text_format.Rd @@ -66,7 +66,7 @@ are selected). For \code{data_addprefix()} or \code{data_addsuffix()}, a charact string, which will be added as prefix or suffix to the column names. For \code{data_rename()}, \code{pattern} can also be a named vector. In this case, names are used as values for the \code{replacement} argument (i.e. \code{pattern} can be a -character vector \verb{ = }).} +character vector using \verb{ = ""}).} } \value{ A character string.