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
fct_lump_n uses partial argument matching when it calls rank, which generates a lot of warnings if you have options(warnPartialMatchArgs = TRUE) and repeatedly call the function (e.g. in a grouped operation).
library(forcats)
options(warnPartialMatchArgs=TRUE)
x<- c("a", "a", "a", "b", "b", "c", "d")
fct_lump_n(x, n=2)
#> Warning in rank(-calcs$count, ties = ties.method): partial argument match of#> 'ties' to 'ties.method'#> [1] a a a b b Other Other#> Levels: a b Other
I think the culprit is here, with the named argument given as ties instead of ties.method.
I haven't tried making the change but happy to PR if this would be welcome. I realise rank is unlikely to change signature but at least for me squelching the warnings would be great
The text was updated successfully, but these errors were encountered:
fct_lump_n
uses partial argument matching when it callsrank
, which generates a lot of warnings if you haveoptions(warnPartialMatchArgs = TRUE)
and repeatedly call the function (e.g. in a grouped operation).I think the culprit is here, with the named argument given as
ties
instead ofties.method
.forcats/R/lump.R
Lines 149 to 154 in ab81d1b
I haven't tried making the change but happy to PR if this would be welcome. I realise
rank
is unlikely to change signature but at least for me squelching the warnings would be greatThe text was updated successfully, but these errors were encountered: