Since I add a default column name, .outcome, to y when it is converted to a tibble, I could just have forge() look for a column named .outcome to be there in new_data. This would require 0 extra effort on my part, it would do this already if I didn’t prematurely error out.
This would also allow the user to pass in a data frame for y (where you obviously know the column name for the outcome) and then request outcomes to be processed in forge(). (You currently can’t do this because that also goes through the XY method)
The only extra thing I would do is have a special check in place if forge(outcomes = TRUE) is requested, and the ".outcome" column doesn’t exist in new_data. It would make it very clear that the user passed a vector to y and that vector was given the name .outcome so that is what forge() is looking for.
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
Since I add a default column name,
.outcome
, toy
when it is converted to a tibble, I could just haveforge()
look for a column named.outcome
to be there innew_data
. This would require 0 extra effort on my part, it would do this already if I didn’t prematurely error out.This would also allow the user to pass in a data frame for
y
(where you obviously know the column name for the outcome) and then request outcomes to be processed in forge(). (You currently can’t do this because that also goes through the XY method)The only extra thing I would do is have a special check in place if
forge(outcomes = TRUE)
is requested, and the".outcome"
column doesn’t exist innew_data
. It would make it very clear that the user passed a vector toy
and that vector was given the name.outcome
so that is whatforge()
is looking for.