View source: R/GetGroupFactor.R
GetGroupFactor | R Documentation |
GetGroupFactor
will split a numeric vector according to a specified gap value. This is often a useful tool and therefore exported to the namespace.
GetGroupFactor(x, gap)
x |
Numeric vector. |
gap |
Difference between two consecutive values at which a split is generated. |
A factor vector of length(x) indicating the different groups in x.
x <- c(1:3,14:12,6:9)
GetGroupFactor(x=x, gap=2)
split(x, GetGroupFactor(x=x, gap=2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.