jonmcalder / refactor

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

include.lowest with inconsistent default #1

Closed lorenzwalthert closed 8 years ago

lorenzwalthert commented 8 years ago

Problem

Depending on how breaks are specified, lowest values are included or not.

Probably due to the default in cut.default, you wanted to keep include.lowest = FALSE. I think it is a counter intuitive default, so let's do away with it and change it to TRUE and hence remove line 78.

jonmcalder commented 8 years ago

Yes I agree. Was trying to keep some consistency with cut.default but it is definitely counter-intuitive for cut.integer so should be changed.

On Sun, 4 Sep 2016, 19:57 lorwal, notifications@github.com wrote:

Problem

Depending on how breaks are specified, lowest values are included or not.

  • cut(sample(10), breaks = 2) gives the levels 1-5 and 6-10 (because the default is overwritten internally on line 78, while
  • cut(sample(10), breaks = c(1, 5, 10)gives the levels 2-5 and 6-10.

Suggested solution

Probably due to the default in cut.default, you wanted to keep include.lowest = FALSE. I think it is a counter intuitive default, so let's do away with it and change it to TRUE and hence remove line 78.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jonmcalder/refactor/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AE0lSo6XxS-YJ3jk1i1oO6MInOPObQ1aks5qmwajgaJpZM4J0lv6 .

lorenzwalthert commented 8 years ago

essentially closed with 4038602