From 76551c29103ae1c717d103c9c31d3424613a38bc Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Fri, 28 Mar 2025 09:48:25 -0700 Subject: [PATCH] clarify composition argument documentation --- R/recipe.R | 11 ++++++----- man/bake.Rd | 6 +----- man/juice.Rd | 6 +----- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/R/recipe.R b/R/recipe.R index 80740cf03..c05ad70cc 100644 --- a/R/recipe.R +++ b/R/recipe.R @@ -639,11 +639,12 @@ prep.recipe <- #' that `prep(retain = TRUE)` was used). See [sparse_data] for more #' information about use of sparse data. #' @param composition Either `"tibble"`, `"matrix"`, `"data.frame"`, or -#' `"dgCMatrix"``for the format of the processed data set. Note that all -#' computations during the baking process are done in a non-sparse format. -#' Also, note that this argument should be called **after** any selectors and -#' the selectors should only resolve to numeric columns (otherwise an error is -#' thrown). +#' `"dgCMatrix"``for the format of the processed data set. Also, note that +#' this argument should be called **after** any selectors and the selectors +#' should only resolve to numeric columns if `composition` is set to +#' `"matrix"` or `"dgCMatrix"`. If the data contains sparse columns they will +#' be perseved for `"tibble"` and `"data.frame"`, and efficiently used for +#' `"dgCMatrix"`. #' #' @details #' diff --git a/man/bake.Rd b/man/bake.Rd index 163691b7d..83d9a49b5 100644 --- a/man/bake.Rd +++ b/man/bake.Rd @@ -24,11 +24,7 @@ that \code{prep(retain = TRUE)} was used). See \link{sparse_data} for more information about use of sparse data.} \item{composition}{Either \code{"tibble"}, \code{"matrix"}, \code{"data.frame"}, or -`"dgCMatrix"``for the format of the processed data set. Note that all -computations during the baking process are done in a non-sparse format. -Also, note that this argument should be called \strong{after} any selectors and -the selectors should only resolve to numeric columns (otherwise an error is -thrown).} +\verb{"dgCMatrix"``for the format of the processed data set. Also, note that this argument should be called **after** any selectors and the selectors should only resolve to numeric columns if }composition\verb{is set to}"matrix"\code{or}"dgCMatrix"\verb{. If the data contains sparse columns they will be perseved for }"tibble"\code{and}"data.frame"\verb{, and efficiently used for }"dgCMatrix"`.} } \value{ A tibble, matrix, or sparse matrix that may have different columns than the diff --git a/man/juice.Rd b/man/juice.Rd index d045c5cda..191c6537f 100644 --- a/man/juice.Rd +++ b/man/juice.Rd @@ -15,11 +15,7 @@ returned by the function. See \code{\link[=selections]{selections()}} for more d selectors are given, the default is to use \code{\link[dplyr:reexports]{dplyr::everything()}}.} \item{composition}{Either \code{"tibble"}, \code{"matrix"}, \code{"data.frame"}, or -`"dgCMatrix"``for the format of the processed data set. Note that all -computations during the baking process are done in a non-sparse format. -Also, note that this argument should be called \strong{after} any selectors and -the selectors should only resolve to numeric columns (otherwise an error is -thrown).} +\verb{"dgCMatrix"``for the format of the processed data set. Also, note that this argument should be called **after** any selectors and the selectors should only resolve to numeric columns if }composition\verb{is set to}"matrix"\code{or}"dgCMatrix"\verb{. If the data contains sparse columns they will be perseved for }"tibble"\code{and}"data.frame"\verb{, and efficiently used for }"dgCMatrix"`.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}}