cleancut {dvmisc} | R Documentation |
So you can stop guess-and-checking with cut
.
cleancut(x, breaks, labels = NULL)
x |
Numeric vector. |
breaks |
Character string, e.g. |
labels |
Character vector. |
Factor or integer vector.
x <- rnorm(100)
y <- cleancut(x, "(-Inf, -1), [-1, 1], (1, Inf)")
tapply(x, y, range)
y <- cleancut(x, "(-Inf, -1), [-1, 1], (1, Inf)", c("<-1", "-1 to 1", ">1"))
tapply(x, y, range)