Skip to content

Commit fd76c36

Browse files
committed
fix lambda(s), styling
1 parent 6a24743 commit fd76c36

File tree

4 files changed

+37
-39
lines changed

4 files changed

+37
-39
lines changed

R/step_yeo_johnson.R

+24-26
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,17 @@
7171
#' plot(density(df$cases))
7272
#' plot(density(filtered_data$cases))
7373
step_epi_YeoJohnson <- function(
74-
recipe,
75-
...,
76-
role = "predictor",
77-
trained = FALSE,
78-
yj_params = NULL,
79-
na_fill = 1 / 4,
80-
limits = c(-5, 5),
81-
num_unique = 5,
82-
na_rm = TRUE,
83-
skip = FALSE,
84-
id = rand_id("epi_YeoJohnson")
85-
) {
74+
recipe,
75+
...,
76+
role = "predictor",
77+
trained = FALSE,
78+
yj_params = NULL,
79+
na_fill = 1 / 4,
80+
limits = c(-5, 5),
81+
num_unique = 5,
82+
na_rm = TRUE,
83+
skip = FALSE,
84+
id = rand_id("epi_YeoJohnson")) {
8685
checkmate::assert_numeric(limits, len = 2)
8786
checkmate::assert_numeric(na_fill, lower = min(limits), upper = max(limits), len = 1)
8887
checkmate::assert_numeric(num_unique, lower = 2, upper = Inf, len = 1)
@@ -109,20 +108,19 @@ step_epi_YeoJohnson <- function(
109108
}
110109

111110
step_epi_YeoJohnson_new <- function(
112-
terms,
113-
role,
114-
trained,
115-
yj_params,
116-
na_fill,
117-
limits,
118-
num_unique,
119-
na_rm,
120-
forecast_date,
121-
metadata,
122-
columns,
123-
skip,
124-
id
125-
) {
111+
terms,
112+
role,
113+
trained,
114+
yj_params,
115+
na_fill,
116+
limits,
117+
num_unique,
118+
na_rm,
119+
forecast_date,
120+
metadata,
121+
columns,
122+
skip,
123+
id) {
126124
step(
127125
subclass = "epi_YeoJohnson",
128126
terms = terms,

man/step_adjust_latency.Rd

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

man/step_epi_YeoJohnson.Rd

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

tests/testthat/test-yeo-johnson.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_that("Yeo-Johnson transformation inverts correctly", {
1111
# Vectorized x and lambda both work
1212
x <- seq(-5, 5, 0.1)
1313
expect_true(
14-
sum(abs(yj_inverse(yj_transform(x, lambda), lambda) - x)) < 1e-5
14+
sum(abs(yj_inverse(yj_transform(x, lambdas), lambdas) - x)) < 1e-5
1515
)
1616
})
1717

0 commit comments

Comments
 (0)