by grayclhn · 5y ago · 0 comments
lm(y ~ ., data = my_dataframe)
already means "regress the variable y on all other columns in `my_dataframe`." For big, interactive regresions, it's really natural to write my_original_dataframe %>%
do_a_bunch_of_tranformations() %>%
select(...) %>% # Pull out just the columns you want
lm(y ~ ., data = .)
and god knows how that last line is going to be interpreted. So disambiguating through some mechanism is necessary anyway. A lambda is much better than some temporary variable that just holds the formula `y ~ .`. cars %>% zlm(dist ~ speed)
(or now) cars |> zlm(dist ~ speed)
https://github.com/torfason/zfitPlus, I still wouldn't trust the code
cars %>% zlm(dist ~ .)
to necessarily work the way I want, or to work the same way across package versions.