jonmcalder / refactor

:bookmark: Better factor handling for R
https://jonmcalder.github.io/refactor/
MIT License
3 stars 0 forks source link

`ordered_result` argument in cut.integer and cut.ordered #11

Open lorenzwalthert opened 7 years ago

lorenzwalthert commented 7 years ago

Currently, the two cut methods for integer and ordered inherit from the default method regarding whether or not the output should be an ordered factor. In the helpfile, it is stated that

Logical: should the result be an ordered factor?

This seems to be a strange behavior since by nature, we are dealing with an sequence of ordered values, otherwise cut could not have been applied.

Hence, I suggest to change the default to TRUE and document this in the help file under details.

jonmcalder commented 7 years ago

Yeah I don't really understand that default either so what you're suggesting makes sense, but at the same time I'm not sure what the ramifications of changing it might be (e.g. for other functions calling cut and expecting non-ordered output).

http://r.789695.n4.nabble.com/R-Why-the-factor-levels-returned-by-cut-are-not-ordered-td813586.html