diff --git a/R/data_modify.R b/R/data_modify.R index 53afcba7b..fa6c33322 100644 --- a/R/data_modify.R +++ b/R/data_modify.R @@ -118,6 +118,7 @@ data_modify.default <- function(data, ...) { insight::format_error("`data` must be a data frame.") } +#' @rdname data_modify #' @export data_modify.data.frame <- function(data, ..., .if = NULL, .at = NULL, .modify = NULL) { dots <- eval(substitute(alist(...))) diff --git a/man/data_modify.Rd b/man/data_modify.Rd index 0eadebc20..d5f5fc96b 100644 --- a/man/data_modify.Rd +++ b/man/data_modify.Rd @@ -2,9 +2,12 @@ % Please edit documentation in R/data_modify.R \name{data_modify} \alias{data_modify} +\alias{data_modify.data.frame} \title{Create new variables in a data frame} \usage{ data_modify(data, ...) + +\method{data_modify}{data.frame}(data, ..., .if = NULL, .at = NULL, .modify = NULL) } \arguments{ \item{data}{A data frame} @@ -32,12 +35,12 @@ Example: \code{Petal.Width = NULL}. Note that newly created variables can be used in subsequent expressions. See also 'Examples'.} -\item{.at}{A character vector of variable names that should be modified. This -argument is used in combination with the \code{.modify} argument.} - \item{.if}{A function that returns \code{TRUE} for columns in the data frame where \code{.if} applies. This argument is used in combination with the \code{.modify} argument.} +\item{.at}{A character vector of variable names that should be modified. This +argument is used in combination with the \code{.modify} argument.} + \item{.modify}{A function that modifies the variables defined in \code{.at} or \code{.if}. This argument is used in combination with either the \code{.at} or the \code{.if}argument. If \code{.modify} is not provided, \code{.at} and \code{.if} are ignored.}