Skip to content

Commit 0c3d2a8

Browse files
committed
fix: attr stuff
1 parent b62dcc6 commit 0c3d2a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/step_yeo_johnson.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ prep.step_epi_YeoJohnson <- function(x, training, info = NULL, ...) {
166166
limits = x$limits,
167167
num_unique = x$num_unique,
168168
na_rm = x$na_rm,
169-
forecast_date = attributes(training)$metadata$as_of,
170-
metadata = attributes(training)$metadata,
169+
forecast_date = attr(training, "metadata")$as_of,
170+
metadata = attr(training, "metadata"),
171171
columns = col_names,
172172
skip = x$skip,
173173
id = x$id
@@ -179,13 +179,13 @@ bake.step_epi_YeoJohnson <- function(object, new_data, ...) {
179179
# If not an epi_df, make it one assuming the template of training data.
180180
# If it is an epi_df, check that the keys match.
181181
# Imitating the pattern in step_adjust_latency().
182-
if (!inherits(new_data, "epi_df") || is.null(attributes(new_data)$metadata$as_of)) {
182+
if (!inherits(new_data, "epi_df") || is.null(attr(new_data, "metadata")$as_of)) {
183183
new_data <- as_epi_df(
184184
new_data,
185185
as_of = object$forecast_date,
186186
other_keys = object$metadata$other_keys %||% character()
187187
)
188-
new_data %@% metadata <- object$metadata
188+
attr(new_data, "metadata") <- object$metadata
189189
}
190190
# Check that the keys match.
191191
keys <- key_colnames(new_data, exclude = "time_value")

0 commit comments

Comments
 (0)