1515# '
1616# ' @param ... Not used.
1717# '
18+ # ' @return
19+ # '
20+ # ' For `default_xy_blueprint()`, an XY blueprint.
21+ # '
1822# ' @details
1923# '
2024# ' As documented in [standardize()], if `y` is a _vector_, then the returned
8892# ' processed <- mold(train_x, train_y)
8993# '
9094# ' # Can't do this!
91- # ' \dontrun{
92- # ' forge(test_x, processed$blueprint, outcomes = TRUE)
93- # ' }
95+ # ' try(forge(test_x, processed$blueprint, outcomes = TRUE))
9496# '
9597# ' # Need to use the full test set, including `y`
9698# ' forge(test, processed$blueprint, outcomes = TRUE)
106108# '
107109# ' # This throws an informative error that tell you
108110# ' # to include an `".outcome"` column in `new_data`.
109- # ' \dontrun{
110- # ' forge(iris, processed_vec$blueprint, outcomes = TRUE)
111- # ' }
111+ # ' try(forge(iris, processed_vec$blueprint, outcomes = TRUE))
112112# '
113113# ' test2 <- test
114114# ' test2$.outcome <- test2$Species
@@ -178,14 +178,20 @@ get_mold_xy_default_function_set <- function() {
178178
179179# mold - xy - clean
180180mold_xy_default_clean <- function (blueprint , x , y ) {
181- c(blueprint , x ) %<- % mold_xy_default_clean_predictors(blueprint , x )
181+ cleaned <- mold_xy_default_clean_predictors(blueprint , x )
182+
183+ blueprint <- cleaned $ blueprint
184+ x <- cleaned $ x
182185
183186 # Special case `y = NULL` as a 0 column variation on `x`
184187 if (is.null(y )) {
185188 y <- x [, 0L , drop = FALSE ]
186189 }
187190
188- c(blueprint , y ) %<- % mold_xy_default_clean_outcomes(blueprint , y )
191+ cleaned <- mold_xy_default_clean_outcomes(blueprint , y )
192+
193+ blueprint <- cleaned $ blueprint
194+ y <- cleaned $ y
189195
190196 out $ mold $ clean_xy(blueprint , x , y )
191197}
@@ -202,9 +208,15 @@ mold_xy_default_clean_outcomes <- function(blueprint, y) {
202208
203209# mold - xy - process
204210mold_xy_default_process <- function (blueprint , x , y ) {
211+ processed <- mold_xy_default_process_predictors(blueprint , x )
205212
206- c(blueprint , predictors_lst ) %<- % mold_xy_default_process_predictors(blueprint , x )
207- c(blueprint , outcomes_lst ) %<- % mold_xy_default_process_outcomes(blueprint , y )
213+ blueprint <- processed $ blueprint
214+ predictors_lst <- processed $ terms_lst
215+
216+ processed <- mold_xy_default_process_outcomes(blueprint , y )
217+
218+ blueprint <- processed $ blueprint
219+ outcomes_lst <- processed $ terms_lst
208220
209221 ptypes <- out $ ptypes $ final(predictors_lst $ ptype , outcomes_lst $ ptype )
210222 extras <- out $ extras $ final(predictors_lst $ extras , outcomes_lst $ extras )
@@ -266,9 +278,15 @@ forge_xy_default_clean <- function(blueprint, new_data, outcomes) {
266278}
267279
268280forge_xy_default_process <- function (blueprint , predictors , outcomes , extras ) {
281+ processed <- forge_xy_default_process_predictors(blueprint , predictors )
282+
283+ blueprint <- processed $ blueprint
284+ predictors_lst <- processed $ terms_lst
285+
286+ processed <- forge_xy_default_process_outcomes(blueprint , outcomes )
269287
270- c( blueprint , predictors_lst ) % <- % forge_xy_default_process_predictors( blueprint , predictors )
271- c( blueprint , outcomes_lst ) % <- % forge_xy_default_process_outcomes( blueprint , outcomes )
288+ blueprint <- processed $ blueprint
289+ outcomes_lst <- processed $ terms_lst
272290
273291 extras <- c(
274292 extras ,
0 commit comments