From f34e76547eccff94396266bd44133bd44002b7a3 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Fri, 23 Feb 2024 12:12:37 -0800 Subject: [PATCH 1/2] have ?tidy.step_* point to step_* --- DESCRIPTION | 2 +- NEWS.md | 2 ++ R/collapse_cart.R | 4 +-- R/collapse_stringdist.R | 4 +-- R/discretize_cart.R | 4 +-- R/discretize_xgb.R | 4 +-- R/embed.R | 4 +-- R/feature_hash.R | 4 +-- R/lencode_bayes.R | 6 ++-- R/lencode_glm.R | 4 +-- R/lencode_mixed.R | 4 +-- R/pca_sparse.R | 4 +-- R/pca_sparse_bayes.R | 4 +-- R/pca_truncated.R | 6 ++-- R/umap.R | 4 +-- R/woe.R | 4 +-- _pkgdown.yml | 3 -- man/step_collapse_cart.Rd | 1 + man/step_collapse_stringdist.Rd | 1 + man/step_discretize_cart.Rd | 1 + man/step_discretize_xgb.Rd | 1 + man/step_embed.Rd | 1 + man/step_feature_hash.Rd | 1 + man/step_lencode_bayes.Rd | 1 + man/step_lencode_glm.Rd | 1 + man/step_lencode_mixed.Rd | 1 + man/step_pca_sparse.Rd | 1 + man/step_pca_sparse_bayes.Rd | 1 + man/step_pca_truncated.Rd | 1 + man/step_umap.Rd | 1 + man/step_woe.Rd | 1 + man/tidy.recipe.Rd | 59 ++------------------------------- 32 files changed, 48 insertions(+), 92 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5167a803..e750c610 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -57,4 +57,4 @@ Config/Needs/website: tidymodels, ggiraph, tidyverse/tidytemplate, reticulate Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 diff --git a/NEWS.md b/NEWS.md index 8b59a08a..07a4446a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,8 @@ * Fixed regression from 1.1.2 in `step_lencode_glm()` where it couldn't be used on multiple columns. +* Calling `?tidy.step_*()` now sends you to the documentation for `step_*()` where the outcome is documented. (#216) + # embed 1.1.2 ## Improvements diff --git a/R/collapse_cart.R b/R/collapse_cart.R index 300135cf..ab627fd5 100644 --- a/R/collapse_cart.R +++ b/R/collapse_cart.R @@ -161,8 +161,8 @@ print.step_collapse_cart <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_collapse_cart` object. +#' @rdname step_collapse_cart +#' @usage NULL #' @export tidy.step_collapse_cart <- function(x, ...) { if (is_trained(x)) { diff --git a/R/collapse_stringdist.R b/R/collapse_stringdist.R index 747b3548..8babed46 100644 --- a/R/collapse_stringdist.R +++ b/R/collapse_stringdist.R @@ -207,8 +207,8 @@ print.step_collapse_stringdist <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_collapse_stringdist` object. +#' @rdname step_collapse_stringdist +#' @usage NULL #' @export tidy.step_collapse_stringdist <- function(x, ...) { if (is_trained(x)) { diff --git a/R/discretize_cart.R b/R/discretize_cart.R index 223469f9..71a9f9a1 100644 --- a/R/discretize_cart.R +++ b/R/discretize_cart.R @@ -275,8 +275,8 @@ print.step_discretize_cart <- function(x, width = max(20, options()$width - 30), invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_discretize_cart` object. +#' @rdname step_discretize_cart +#' @usage NULL #' @export tidy.step_discretize_cart <- function(x, ...) { if (is_trained(x)) { diff --git a/R/discretize_xgb.R b/R/discretize_xgb.R index 00d08378..ef694bbb 100644 --- a/R/discretize_xgb.R +++ b/R/discretize_xgb.R @@ -509,8 +509,8 @@ print.step_discretize_xgb <- function(x, width = max(20, options()$width - 30), invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_discretize_xgb` object. +#' @rdname step_discretize_xgb +#' @usage NULL #' @export tidy.step_discretize_xgb <- function(x, ...) { if (is_trained(x)) { diff --git a/R/embed.R b/R/embed.R index 5ae91995..f243fa28 100644 --- a/R/embed.R +++ b/R/embed.R @@ -431,8 +431,8 @@ bake.step_embed <- function(object, new_data, ...) { new_data } -#' @rdname tidy.recipe -#' @param x A `step_embed` object. +#' @rdname step_embed +#' @usage NULL #' @export tidy.step_embed <- function(x, ...) { if (is_trained(x)) { diff --git a/R/feature_hash.R b/R/feature_hash.R index c33eb82e..269a602e 100644 --- a/R/feature_hash.R +++ b/R/feature_hash.R @@ -232,8 +232,8 @@ print.step_feature_hash <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_feature_hash` object. +#' @rdname step_feature_hash +#' @usage NULL #' @export tidy.step_feature_hash <- function(x, ...) { if (is_trained(x)) { diff --git a/R/lencode_bayes.R b/R/lencode_bayes.R index ceca992e..38d59bf9 100644 --- a/R/lencode_bayes.R +++ b/R/lencode_bayes.R @@ -267,9 +267,9 @@ print.step_lencode_bayes <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_lencode_bayes` object. -#' @export + #' @rdname step_lencode_bayes + #' @usage NULL + #' @export tidy.step_lencode_bayes <- function(x, ...) { if (is_trained(x)) { if (length(x$mapping) == 0) { diff --git a/R/lencode_glm.R b/R/lencode_glm.R index f4713d4e..d799be47 100644 --- a/R/lencode_glm.R +++ b/R/lencode_glm.R @@ -221,8 +221,8 @@ print.step_lencode_glm <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_lencode_glm` object. +#' @rdname step_lencode_glm +#' @usage NULL #' @export tidy.step_lencode_glm <- function(x, ...) { if (is_trained(x)) { diff --git a/R/lencode_mixed.R b/R/lencode_mixed.R index e6d1ab53..62c6bf15 100644 --- a/R/lencode_mixed.R +++ b/R/lencode_mixed.R @@ -261,8 +261,8 @@ print.step_lencode_mixed <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_lencode_mixed` object. +#' @rdname step_lencode_mixed +#' @usage NULL #' @export tidy.step_lencode_mixed <- function(x, ...) { if (is_trained(x)) { diff --git a/R/pca_sparse.R b/R/pca_sparse.R index adebb920..76eca11c 100644 --- a/R/pca_sparse.R +++ b/R/pca_sparse.R @@ -243,8 +243,8 @@ pca_coefs <- function(x) { res } -#' @rdname tidy.recipe -#' @param x A `step_pca_sparse` object. +#' @rdname step_pca_sparse +#' @usage NULL #' @export tidy.step_pca_sparse <- function(x, ...) { if (!is_trained(x)) { diff --git a/R/pca_sparse_bayes.R b/R/pca_sparse_bayes.R index 38d44b7d..2925871e 100644 --- a/R/pca_sparse_bayes.R +++ b/R/pca_sparse_bayes.R @@ -247,8 +247,8 @@ print.step_pca_sparse_bayes <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_pca_sparse_bayes` object. +#' @rdname step_pca_sparse_bayes +#' @usage NULL #' @export tidy.step_pca_sparse_bayes <- function(x, ...) { if (!is_trained(x)) { diff --git a/R/pca_truncated.R b/R/pca_truncated.R index 1e43daed..7e84eeae 100644 --- a/R/pca_truncated.R +++ b/R/pca_truncated.R @@ -260,10 +260,8 @@ pca_variances <- function(x) { res } -#' @rdname tidy.recipe -#' @param type For `step_pca_truncated`, either `"coef"` (for the variable -#' loadings per component) or `"variance"` (how much variance does each -#' component account for). +#' @rdname step_pca_truncated +#' @usage NULL #' @export tidy.step_pca_truncated <- function(x, type = "coef", ...) { if (!is_trained(x)) { diff --git a/R/umap.R b/R/umap.R index a20c3e9d..f352a22a 100644 --- a/R/umap.R +++ b/R/umap.R @@ -315,8 +315,8 @@ print.step_umap <- invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_umap` object. +#' @rdname step_umap +#' @usage NULL #' @export tidy.step_umap <- function(x, ...) { if (is_trained(x)) { diff --git a/R/woe.R b/R/woe.R index 34f0b139..a5a8786d 100644 --- a/R/woe.R +++ b/R/woe.R @@ -486,8 +486,8 @@ print.step_woe <- function(x, width = max(20, options()$width - 29), ...) { invisible(x) } -#' @rdname tidy.recipe -#' @param x A `step_woe` object. +#' @rdname step_woe +#' @usage NULL #' @export tidy.step_woe <- function(x, ...) { if (is_trained(x)) { diff --git a/_pkgdown.yml b/_pkgdown.yml index 3a29774d..66919473 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -41,9 +41,6 @@ reference: - title: miscellaneous contents: - dictionary -- title: Tidy Methods - contents: - - tidy.recipe figures: fig.width: 8 diff --git a/man/step_collapse_cart.Rd b/man/step_collapse_cart.Rd index 7dbf7049..39a60188 100644 --- a/man/step_collapse_cart.Rd +++ b/man/step_collapse_cart.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/collapse_cart.R \name{step_collapse_cart} \alias{step_collapse_cart} +\alias{tidy.step_collapse_cart} \title{Supervised Collapsing of Factor Levels} \usage{ step_collapse_cart( diff --git a/man/step_collapse_stringdist.Rd b/man/step_collapse_stringdist.Rd index 28b58a27..9dd27ca6 100644 --- a/man/step_collapse_stringdist.Rd +++ b/man/step_collapse_stringdist.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/collapse_stringdist.R \name{step_collapse_stringdist} \alias{step_collapse_stringdist} +\alias{tidy.step_collapse_stringdist} \title{collapse factor levels using stringdist} \usage{ step_collapse_stringdist( diff --git a/man/step_discretize_cart.Rd b/man/step_discretize_cart.Rd index 34a9084e..6bd9ee45 100644 --- a/man/step_discretize_cart.Rd +++ b/man/step_discretize_cart.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/discretize_cart.R \name{step_discretize_cart} \alias{step_discretize_cart} +\alias{tidy.step_discretize_cart} \title{Discretize numeric variables with CART} \usage{ step_discretize_cart( diff --git a/man/step_discretize_xgb.Rd b/man/step_discretize_xgb.Rd index ddd9ff5c..4dd4b3bc 100644 --- a/man/step_discretize_xgb.Rd +++ b/man/step_discretize_xgb.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/discretize_xgb.R \name{step_discretize_xgb} \alias{step_discretize_xgb} +\alias{tidy.step_discretize_xgb} \title{Discretize numeric variables with XgBoost} \usage{ step_discretize_xgb( diff --git a/man/step_embed.Rd b/man/step_embed.Rd index d8ca7846..06ed16b6 100644 --- a/man/step_embed.Rd +++ b/man/step_embed.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/embed.R \name{step_embed} \alias{step_embed} +\alias{tidy.step_embed} \alias{embed_control} \title{Encoding Factors into Multiple Columns} \usage{ diff --git a/man/step_feature_hash.Rd b/man/step_feature_hash.Rd index 18bfe7f6..b6572c78 100644 --- a/man/step_feature_hash.Rd +++ b/man/step_feature_hash.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/feature_hash.R \name{step_feature_hash} \alias{step_feature_hash} +\alias{tidy.step_feature_hash} \title{Dummy Variables Creation via Feature Hashing} \usage{ step_feature_hash( diff --git a/man/step_lencode_bayes.Rd b/man/step_lencode_bayes.Rd index 87f0f7ff..2cae8f11 100644 --- a/man/step_lencode_bayes.Rd +++ b/man/step_lencode_bayes.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/lencode_bayes.R \name{step_lencode_bayes} \alias{step_lencode_bayes} +\alias{tidy.step_lencode_bayes} \title{Supervised Factor Conversions into Linear Functions using Bayesian Likelihood Encodings} \usage{ diff --git a/man/step_lencode_glm.Rd b/man/step_lencode_glm.Rd index a6901d39..42c0b9da 100644 --- a/man/step_lencode_glm.Rd +++ b/man/step_lencode_glm.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/lencode_glm.R \name{step_lencode_glm} \alias{step_lencode_glm} +\alias{tidy.step_lencode_glm} \title{Supervised Factor Conversions into Linear Functions using Likelihood Encodings} \usage{ diff --git a/man/step_lencode_mixed.Rd b/man/step_lencode_mixed.Rd index c6af3397..6e481412 100644 --- a/man/step_lencode_mixed.Rd +++ b/man/step_lencode_mixed.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/lencode_mixed.R \name{step_lencode_mixed} \alias{step_lencode_mixed} +\alias{tidy.step_lencode_mixed} \title{Supervised Factor Conversions into Linear Functions using Bayesian Likelihood Encodings} \usage{ diff --git a/man/step_pca_sparse.Rd b/man/step_pca_sparse.Rd index e22cad73..a2197b48 100644 --- a/man/step_pca_sparse.Rd +++ b/man/step_pca_sparse.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/pca_sparse.R \name{step_pca_sparse} \alias{step_pca_sparse} +\alias{tidy.step_pca_sparse} \title{Sparse PCA Signal Extraction} \usage{ step_pca_sparse( diff --git a/man/step_pca_sparse_bayes.Rd b/man/step_pca_sparse_bayes.Rd index 5ef0d27a..53ba758c 100644 --- a/man/step_pca_sparse_bayes.Rd +++ b/man/step_pca_sparse_bayes.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/pca_sparse_bayes.R \name{step_pca_sparse_bayes} \alias{step_pca_sparse_bayes} +\alias{tidy.step_pca_sparse_bayes} \title{Sparse Bayesian PCA Signal Extraction} \usage{ step_pca_sparse_bayes( diff --git a/man/step_pca_truncated.Rd b/man/step_pca_truncated.Rd index 28b70af5..7213515a 100644 --- a/man/step_pca_truncated.Rd +++ b/man/step_pca_truncated.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/pca_truncated.R \name{step_pca_truncated} \alias{step_pca_truncated} +\alias{tidy.step_pca_truncated} \title{Truncated PCA Signal Extraction} \usage{ step_pca_truncated( diff --git a/man/step_umap.Rd b/man/step_umap.Rd index d7592069..8a895b63 100644 --- a/man/step_umap.Rd +++ b/man/step_umap.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/umap.R \name{step_umap} \alias{step_umap} +\alias{tidy.step_umap} \title{Supervised and unsupervised uniform manifold approximation and projection (UMAP)} \usage{ diff --git a/man/step_woe.Rd b/man/step_woe.Rd index 580d7a0e..e67b00f2 100644 --- a/man/step_woe.Rd +++ b/man/step_woe.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/woe.R \name{step_woe} \alias{step_woe} +\alias{tidy.step_woe} \title{Weight of evidence transformation} \usage{ step_woe( diff --git a/man/tidy.recipe.Rd b/man/tidy.recipe.Rd index 404ba7e3..0859b395 100644 --- a/man/tidy.recipe.Rd +++ b/man/tidy.recipe.Rd @@ -1,63 +1,8 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/collapse_cart.R, R/collapse_stringdist.R, -% R/discretize_cart.R, R/discretize_xgb.R, R/embed.R, R/feature_hash.R, -% R/lencode_bayes.R, R/lencode_glm.R, R/lencode_mixed.R, R/pca_sparse.R, -% R/pca_sparse_bayes.R, R/pca_truncated.R, R/tidy.R, R/umap.R, R/woe.R -\name{tidy.step_collapse_cart} -\alias{tidy.step_collapse_cart} -\alias{tidy.step_collapse_stringdist} -\alias{tidy.step_discretize_cart} -\alias{tidy.step_discretize_xgb} -\alias{tidy.step_embed} -\alias{tidy.step_feature_hash} -\alias{tidy.step_lencode_bayes} -\alias{tidy.step_lencode_glm} -\alias{tidy.step_lencode_mixed} -\alias{tidy.step_pca_sparse} -\alias{tidy.step_pca_sparse_bayes} -\alias{tidy.step_pca_truncated} +% Please edit documentation in R/tidy.R +\name{tidy.recipe} \alias{tidy.recipe} -\alias{tidy.step_umap} -\alias{tidy.step_woe} \title{Tidy the Result of a Recipe} -\usage{ -\method{tidy}{step_collapse_cart}(x, ...) - -\method{tidy}{step_collapse_stringdist}(x, ...) - -\method{tidy}{step_discretize_cart}(x, ...) - -\method{tidy}{step_discretize_xgb}(x, ...) - -\method{tidy}{step_embed}(x, ...) - -\method{tidy}{step_feature_hash}(x, ...) - -\method{tidy}{step_lencode_bayes}(x, ...) - -\method{tidy}{step_lencode_glm}(x, ...) - -\method{tidy}{step_lencode_mixed}(x, ...) - -\method{tidy}{step_pca_sparse}(x, ...) - -\method{tidy}{step_pca_sparse_bayes}(x, ...) - -\method{tidy}{step_pca_truncated}(x, type = "coef", ...) - -\method{tidy}{step_umap}(x, ...) - -\method{tidy}{step_woe}(x, ...) -} -\arguments{ -\item{x}{A \code{step_woe} object.} - -\item{...}{Not currently used.} - -\item{type}{For \code{step_pca_truncated}, either \code{"coef"} (for the variable -loadings per component) or \code{"variance"} (how much variance does each -component account for).} -} \description{ \code{tidy} will return a data frame that contains information regarding a recipe or operation within the recipe (when a \code{tidy} method for the operation From 3fb9824bc1c5eb265093120446c790b46bbc18a3 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Fri, 23 Feb 2024 12:28:09 -0800 Subject: [PATCH 2/2] delete tidy.R file --- R/tidy.R | 10 ---------- man/tidy.recipe.Rd | 10 ---------- 2 files changed, 20 deletions(-) delete mode 100644 R/tidy.R delete mode 100644 man/tidy.recipe.Rd diff --git a/R/tidy.R b/R/tidy.R deleted file mode 100644 index 299a7710..00000000 --- a/R/tidy.R +++ /dev/null @@ -1,10 +0,0 @@ -#' Tidy the Result of a Recipe -#' -#' `tidy` will return a data frame that contains information regarding a recipe -#' or operation within the recipe (when a `tidy` method for the operation -#' exists). See [recipes::tidy.recipe] for more information. -#' -#' @name tidy.recipe -#' -#' @inheritParams recipes::tidy.recipe -NULL diff --git a/man/tidy.recipe.Rd b/man/tidy.recipe.Rd deleted file mode 100644 index 0859b395..00000000 --- a/man/tidy.recipe.Rd +++ /dev/null @@ -1,10 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/tidy.R -\name{tidy.recipe} -\alias{tidy.recipe} -\title{Tidy the Result of a Recipe} -\description{ -\code{tidy} will return a data frame that contains information regarding a recipe -or operation within the recipe (when a \code{tidy} method for the operation -exists). See \link[recipes:tidy.recipe]{recipes::tidy.recipe} for more information. -}