% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilities.R
\name{getGroups}
\alias{getGroups}
\title{Determine groups and group means}
\usage{
getGroups(x, n = NULL, equidistant = FALSE)
}
\arguments{
\item{x}{Numeric vector to be split.}

\item{n}{Desired number of groups. If \code{NULL}, the function chooses
roughly one group per 100 observations, constrained to 3 \eqn{\le} n \eqn{\le} 20.}

\item{equidistant}{If \code{TRUE}, intervals have equal width; otherwise
(default) each interval contains roughly the same number of observations.}
}
\value{
Numeric vector of the same length as \code{x} with the group mean
  assigned to each observation.
}
\description{
Splits a continuous variable into \code{n} groups (either equidistant or
with equal number of observations) and returns the group mean for every
observation.
}
\examples{
\dontrun{
x <- rnorm(1000, mean = 50, sd = 10)
m <- getGroups(x, n = 10)
}
}
