| getGroups | R Documentation |
Splits a continuous variable into n groups (either equidistant or
with equal number of observations) and returns the group mean for every
observation.
getGroups(x, n = NULL, equidistant = FALSE)
x |
Numeric vector to be split. |
n |
Desired number of groups. If |
equidistant |
If |
Numeric vector of the same length as x with the group mean
assigned to each observation.
## Not run:
x <- rnorm(1000, mean = 50, sd = 10)
m <- getGroups(x, n = 10)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.