tidyverse / modelr

Helper functions for modelling
https://modelr.tidyverse.org
GNU General Public License v3.0
401 stars 66 forks source link

Using add_predictors with names of primitive functions gives an error #121

Closed dhalpern closed 10 months ago

dhalpern commented 1 year ago

Using add_predictors with variables that share names with primitive functions gives: Error: Cannot merge formulas as their scopes conflict for the symbol when that variable is already included in some way in the base formula. It might be best practice to not have columns of your data frame share a name with these functions but perhaps there's a simple solution? Below are two examples that both get the error

ff <- formulas(~z,
               m1 = ~sqrt,
               m2 = add_predictors(m1, ~sqrt^2)
)

ff <- formulas(~z,
               m1 = ~list,
               m2 = add_predictors(m1, ~(1 | list))
)
hadley commented 10 months ago

modelr is now superseded, which means that we'll only perform critical bug fixes needed to keep it on CRAN. Thanks for contributing this idea and my apologies that it took so long to inform you that this package is no longer under development.