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
{{ message }}
Repository navigation
Some minor (but breaking) suggestions for categorize() #709
Current behavior is to return an integer vector. To be consistent with cut(), and to be safer to use, I think this function should return by default a factor - possible an ordered factor.
also I think we can drop the lowest argument?
The breaks argument in R is usually used to provide the breaking values - here if those are done manually, they are sent to split instead.
Rename split to method?
We should add a right = TRUE argument, like with cut().
We should add a right = TRUE argument, like with cut().
The right argument is handled like this: cut(..., right = identical(breaks, "inclusive")).
Rename split to method?
split currently also accept a numeric vector with values that define the splits, thus, I'd say a method argument is not fully appropriate?
Current behavior is to return an integer vector. To be consistent with cut(), and to be safer to use, I think this function should return by default a factor - possible an ordered factor.
Not for factors, only for numerics. When you use the labels argument, a factor is always returned.
Activity
strengejacke commentedon Sep 8, 2026
The
rightargument is handled like this:cut(..., right = identical(breaks, "inclusive")).splitcurrently also accept a numeric vector with values that define the splits, thus, I'd say amethodargument is not fully appropriate?Not for factors, only for numerics. When you use the
labelsargument, a factor is always returned.