jonmcalder / refactor

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

breaks given as integers yield error #6

Closed lorenzwalthert closed 8 years ago

lorenzwalthert commented 8 years ago

Problem

Because of the assertive test in cut.integer for breaks, something like cut(sample(10), breaks = c(1L, 3L, 10L) fails.

Solution

Use assert(check_class(breaks, "integer"), check_class(breaks, "numeric"))