Skip to content
Prev 63366 / 63421 Next

rep.int and rep_len do not drop names attribute

This is a consequence of the following change in R 4.0.0 (r77905):

     ? When internal dispatch for ?rep.int()? and ?rep_len()?
       fails, there is an attempt to dispatch on the equivalent
       call to ?rep()?.

I believe it wasn't intended to change the handling of factors and I 
think it would be desirable to restore the original (and still 
documented) behavior of dropping names for rep.int(<factor>) and 
rep_len(<factor>), so skip the (early) 'rep' fallback if `inherits(s, 
"factor")`.

It would be good to report this in R's Bugzilla 
<https://bugs.R-project.org/>, so there is a PR# for future reference. 
At a first glance the patch looks simple (and should include a 
regression test).

	Sebastian Meyer


Am 25.01.26 um 11:32 schrieb Rui Barradas: