Skip to content

Commit fdd1a44

Browse files
committed
doc+fix: cmd check warnings
1 parent 7690145 commit fdd1a44

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

R/layer_yeo_johnson.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#'
55
#' @param frosting a `frosting` postprocessor. The layer will be added to the
66
#' sequence of operations for this frosting.
7+
#' @param lambdas Internal. A data frame of lambda values to be used for
8+
#' inverting the transformation.
79
#' @param ... One or more selector functions to scale variables
810
#' for this step. See [recipes::selections()] for more details.
9-
#' @param df a data frame that contains the population data to be used for
10-
#' inverting the existing scaling.
1111
#' @param by A (possibly named) character vector of variables to join by.
1212
#' @param id a random id string
1313
#'
@@ -56,7 +56,7 @@ layer_epi_YeoJohnson <- function(frosting, ..., lambdas = NULL, by = NULL, id =
5656
}
5757

5858
layer_epi_YeoJohnson_new <- function(lambdas, by, terms, id) {
59-
epipredict:::layer("epi_YeoJohnson", lambdas = lambdas, by = by, terms = terms, id = id)
59+
layer("epi_YeoJohnson", lambdas = lambdas, by = by, terms = terms, id = id)
6060
}
6161

6262
#' @export
@@ -94,7 +94,7 @@ slather.layer_epi_YeoJohnson <- function(object, components, workflow, new_data,
9494
# Establish the join columns.
9595
object$by <- object$by %||%
9696
intersect(
97-
epipredict:::epi_keys_only(components$predictions),
97+
epi_keys_only(components$predictions),
9898
colnames(select(lambdas, -starts_with(".lambda_")))
9999
)
100100
joinby <- list(x = names(object$by) %||% object$by, y = object$by)
@@ -180,7 +180,7 @@ slather.layer_epi_YeoJohnson <- function(object, components, workflow, new_data,
180180
#' @export
181181
print.layer_epi_YeoJohnson <- function(x, width = max(20, options()$width - 30), ...) {
182182
title <- "Yeo-Johnson transformation (see `lambdas` object for values) on "
183-
epipredict:::print_layer(x$terms, title = title, width = width)
183+
print_layer(x$terms, title = title, width = width)
184184
}
185185

186186
# Inverse Yeo-Johnson transformation

R/step_yeo_johnson.R

+11-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
#' transform data using a Yeo-Johnson transformation. This fork works with panel
55
#' data and is meant for epidata.
66
#'
7+
#' @param recipe A recipe object. The step will be added to the
8+
#' sequence of operations for this recipe.
9+
#' @param ... One or more selector functions to choose variables
10+
#' for this step. See [recipes::selections()] for more details.
11+
#' @param role For model terms created by this step, what analysis role should
12+
#' they be assigned? `lag` is default a predictor while `ahead` is an outcome.
13+
#' @param trained A logical for whether the selectors in `...`
14+
#' have been resolved by [prep()].
715
#' @param lambdas Internal. A numeric vector of transformation values. This
816
#' is `NULL` until computed by [prep()].
917
#' @param na_lambda_fill A numeric value to fill in for any
@@ -17,6 +25,7 @@
1725
#' @param skip A logical. Should the step be skipped when the recipe is
1826
#' baked by [bake()]. On the `training` data, the step will always be
1927
#' conducted (even if `skip = TRUE`).
28+
#' @param id A unique identifier for the step
2029
#' @template step-return
2130
#' @family individual transformation steps
2231
#' @export
@@ -219,7 +228,7 @@ bake.step_epi_YeoJohnson <- function(object, new_data, ...) {
219228
#' @export
220229
print.step_epi_YeoJohnson <- function(x, width = max(20, options()$width - 39), ...) {
221230
title <- "Yeo-Johnson transformation (see `lambdas` object for values) on "
222-
epipredict:::print_epi_step(x$terms, x$terms, title = title, width = width)
231+
print_epi_step(x$terms, x$terms, title = title, width = width)
223232
invisible(x)
224233
}
225234

@@ -232,7 +241,7 @@ get_lambdas_yj_table <- function(training, col_names, limits, num_unique, na_lam
232241
across(all_of(col_names), ~ estimate_yj(.x, limits, num_unique, na_rm)),
233242
.by = all_of(epi_keys_checked)
234243
) %>%
235-
rename_with(~ paste0(".lambda_", .x), -all_of(epi_keys_checked))
244+
dplyr::rename_with(~ paste0(".lambda_", .x), -all_of(epi_keys_checked))
236245

237246
# Check for NAs in any of the lambda_ columns.
238247
# EDIT: This warning was too noisy. Keeping code around, in case we want it.

man/layer_epi_YeoJohnson.Rd

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/step_epi_YeoJohnson.Rd

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)