Closed
Description
When I was trying to reproduce #1060, this was my first go at a minimal reprex. There's no error here (at least for this engine), but parsnip takes only the first observation (and I'm assuming it's recycled later on?)
library(parsnip)
fit_xy(
linear_reg(),
data.frame(x = 1:5),
y = structure(2:6, label = "hi")
)
#> parsnip model object
#>
#>
#> Call:
#> stats::lm(formula = ..y ~ ., data = data)
#>
#> Coefficients:
#> (Intercept) x
#> 2.000e+00 1.573e-16
Created on 2024-02-02 with reprex v2.1.0
Notice intercept is 2 and slope is basically zero. This is because the outcome is always 2:6[[1]]
😬
Offending code:
Lines 270 to 276 in 8ccf1be