equal_discrete | R Documentation |
Returns a function that converts a continuous numeric vector into an integer vector with discrete levels.
equal_discrete(nlevels)
nlevels |
number of levels to split continuous vector into |
function that makes a numeric vector discrete
# test data
x <- 1:10
# create and apply function to split x into 2 discrete levels
split_2 <- equal_discrete(2)
split_2(x)
# create and apply function to split x into 5 discrete levels
split_5 <- equal_discrete(5)
split_5(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.