powered by
Mapping from continuous to categorical
cut_mapping(..., to = NULL, na = NA, ch.as.fact = TRUE)
Passed to cut().
cut()
Passed to mapping().
mapping()
A function that cuts a numeric vector and maps the result.
numeric
# NOT RUN { x <- c(0, 10, 20, 30, Inf) m <- cut_mapping(x, right=FALSE, to=c("0 to <10", "10 to <20", "20 to <30", ">= 30")) print(m) m(c(5, 27, 3, 10, 99)) # }
Run the code above in your browser using DataLab