From 7ee80ca86540a21bb425138d18173a0d94dd4488 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 13 Dec 2024 10:13:42 +0100 Subject: [PATCH] docs --- R/data_rename.R | 5 +++++ R/data_rescale.R | 4 +++- R/data_to_long.R | 4 +++- man/data_rename.Rd | 4 ++++ man/rescale.Rd | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/R/data_rename.R b/R/data_rename.R index 282aaeff4..28fd61704 100644 --- a/R/data_rename.R +++ b/R/data_rename.R @@ -1,4 +1,5 @@ #' @title Rename columns and variable names +#' @name data_rename #' #' @description Safe and intuitive functions to rename variables or rows in #' data frames. `data_rename()` will rename column names, i.e. it facilitates @@ -47,6 +48,10 @@ #' `select` can also be a named character vector. In this case, the names are #' used to rename the columns in the output data frame. See 'Examples'. #' +#' `data_rename()` also works with list-inputs, but in this case, `select` must +#' be a character vector with valid names. It is not possible to use +#' select-helpers when `data` is a list. +#' #' @return A modified data frame. #' #' @examples diff --git a/R/data_rescale.R b/R/data_rescale.R index 5707e38f0..ad2742497 100644 --- a/R/data_rescale.R +++ b/R/data_rescale.R @@ -1,5 +1,7 @@ -#' Rescale Variables to a New Range +#' @title Rescale Variables to a New Range +#' @name rescale #' +#' @description #' Rescale variables to a new range. Can also be used to reverse-score variables #' (change the keying/scoring direction), or to expand a range. #' diff --git a/R/data_to_long.R b/R/data_to_long.R index deffcc0cb..01d41a81c 100644 --- a/R/data_to_long.R +++ b/R/data_to_long.R @@ -1,5 +1,7 @@ -#' Reshape (pivot) data from wide to long +#' @title Reshape (pivot) data from wide to long +#' @name data_to_long #' +#' @description #' This function "lengthens" data, increasing the number of rows and decreasing #' the number of columns. This is a dependency-free base-R equivalent of #' `tidyr::pivot_longer()`. diff --git a/man/data_rename.Rd b/man/data_rename.Rd index 8d99fb54f..a2cd83703 100644 --- a/man/data_rename.Rd +++ b/man/data_rename.Rd @@ -114,6 +114,10 @@ possible pipe-workflow. \details{ \code{select} can also be a named character vector. In this case, the names are used to rename the columns in the output data frame. See 'Examples'. + +\code{data_rename()} also works with list-inputs, but in this case, \code{select} must +be a character vector with valid names. It is not possible to use +select-helpers when \code{data} is a list. } \examples{ # Rename columns diff --git a/man/rescale.Rd b/man/rescale.Rd index f163a6e8c..0744ca3ba 100644 --- a/man/rescale.Rd +++ b/man/rescale.Rd @@ -135,6 +135,10 @@ Rescale variables to a new range. Can also be used to reverse-score variables \details{ \code{select} can also be a named character vector. In this case, the names are used to rename the columns in the output data frame. See 'Examples'. + +\code{data_rename()} also works with list-inputs, but in this case, \code{select} must +be a character vector with valid names. It is not possible to use +select-helpers when \code{data} is a list. } \section{Selection of variables - the \code{select} argument}{