You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently, warnings about dropped trends only comes up with set_contrasts. Something like enlist_contrasts(df, x ~ sum_code - 3:4) will just ignore the - operator at the level of use_contrasts.
I think this can be refactored entirely at the level of .make_parameters, specifically with .process_code_by by checking if params[['code_by']] is a polynomial scheme and if params[['drop_trends']] is not NA. If both are true, then the latter can be reset to NA and a warning can be issued, which will be present regardless of set/enlist/glimpse_contrasts. .reinstate_dropped_trends can then be removed entirely, omitting the regular expression wellformedness check.
The text was updated successfully, but these errors were encountered:
just a note but most of this can be put on .make_parameters, but there does need to be some way to check whether this is occurring within set_contrasts or not, otherwise set_contrasts(df, x ~ contr.poly - 3:5) will still work when it shouldn't
This is implemented now, and .reinstate_dropped_trends has indeed been completely removed 🎉.
The implementation has set_contrasts set an attribute on the list of formulas, which is checked in enlist_contrasts. If present, .process_contrasts will ignore the - operator via the omit_drop parameter. The user can replicate this behavior by setting the omit_drop attribute themselves but by and large i doubt people would bother.
.make_parameters will handle the separate warning when the - operator is used with non-polynomial scheme functions. This already prevents the drop_trends parameter from being set to anything besides NA, so you don't get 2 warnings for things like set_contrasts(mtcars, carb ~ contr.sum - 4:6).
The one downside is that the user will get multiple warnings for every formula containing a - operator when used with a polynomial scheme in set_contrasts rather than a single warning listing all the problematic formulas. But, hopefully this drives home the point that this usage is not supported.
currently, warnings about dropped trends only comes up with set_contrasts. Something like
enlist_contrasts(df, x ~ sum_code - 3:4)
will just ignore the-
operator at the level ofuse_contrasts
.I think this can be refactored entirely at the level of
.make_parameters
, specifically with.process_code_by
by checking ifparams[['code_by']]
is a polynomial scheme and ifparams[['drop_trends']]
is not NA. If both are true, then the latter can be reset to NA and a warning can be issued, which will be present regardless of set/enlist/glimpse_contrasts..reinstate_dropped_trends
can then be removed entirely, omitting the regular expression wellformedness check.The text was updated successfully, but these errors were encountered: