sis_discretize | R Documentation |
Converts a vector of numbers into a vector of 0 and 1 based on whether they are below or above some value. There are two ways to do this: based on percentile or based on a numeric cutoff. By default, it will separate it based on the 50th percentile (cutoff of 0.5), but you can change the cutoff value and whether it is used as percentile or trait value.
sis_discretize(x, cutoff = 0.5, use_percentile = TRUE)
x |
Vector of continuous trait values |
cutoff |
Value to use as cutoff. If percentile, 0.3 = 30th percentile, etc. |
use_percentile |
If TRUE, use cutoff as percentile |
a vector of 0 and 1 (and NAs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.