% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mf_get_breaks.R
\name{mf_get_breaks}
\alias{mf_get_breaks}
\title{Get class intervals}
\usage{
mf_get_breaks(x, nbreaks, breaks, k = 1, central = FALSE, ...)
}
\arguments{
\item{x}{a vector of numeric values. NA and Inf values are not used in the
classification.}

\item{nbreaks}{a number of classes}

\item{breaks}{a classification method; the main methods are "quantile",
"equal", "msd", "ckmeans" (natural breaks), "Q6" and "geom".
See Details for the full list.}

\item{k}{number of standard deviation for "msd" method (see Details)}

\item{central}{creation of a central class for "msd" method (see Details)}

\item{...}{further arguments
of \code{\link[classInt:classIntervals]{classIntervals}}}
}
\value{
A numeric vector of breaks
}
\description{
A function to classify continuous variables.

This function is a wrapper for
\code{\link[classInt:classIntervals]{classIntervals}}
with some additional methods.
}
\details{
\subsection{\code{classInt} methods}{

"fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust",
"fisher", "jenks", "dpih", "headtails", "maximum", and "box"
are \code{\link[classInt:classIntervals]{classIntervals}}
methods. You may need to pass additional arguments for some of them.
}

\subsection{Natural breaks method}{

The "jenks", "fisher" and "ckmeans" methods are based on the same concept of
\strong{natural breaks} and and produce similar groupings. The use of "ckmeans" is
recommended.
\itemize{
\item The "jenks" method produces class boundaries falling on data points and is
slow.
\item The "fisher" method produces class boundaries located more conveniently
between data points, and is faster than the "jenks" method.
\item The "ckmeans" method produces exactly the same class boundaries as the
"fisher" method, but is much faster. It uses the optimal univariate
k-means method from the \code{Ckmeans.1d.dp} package.
If the "ckmeans" method is selected but the \code{Ckmeans.1d.dp} package is not
installed then the "fisher" method is used.
}

The relative speeds of these three methods may vary depending on the number
of data points and the number of classes.
}

\subsection{Other methods}{

The "msd" method is based on the \strong{mean} and the \strong{standard deviation}
of a numeric vector.
The \code{nbreaks} parameter is not relevant, use \code{k} and
\code{central} instead. \code{k} indicates
the extent of each class in share of standard deviation.
If \code{central=TRUE} then
the mean value is the center of a class else the mean is a break value.\cr\cr
The "q6" method uses the following \code{\link[stats:quantile]{quantile}}
probabilities: 0, 0.05, 0.275, 0.5, 0.725, 0.95, 1.\cr\cr
The "Q6" method uses the following \code{\link[stats:quantile]{quantile}}
probabilities: 0, 0.05, 0.25, 0.5, 0.75, 0.95, 1.\cr\cr
The "geom" method is based on a geometric progression along
the variable values, all values must be strictly greater than zero.\cr\cr
The "arith" method is based on an arithmetic progression along
the variable values.\cr\cr
The "em" method is based on nested averages computation.
}

\subsection{Class boundaries}{

Breaks defined by a numeric vector or a classification method are
left-closed: breaks defined by \code{c(2, 5, 10, 15, 20)}
will be mapped as [2 - 5[, [5 - 10[, [10 - 15[, [15 - 20].
}
}
\examples{
mtq <- mf_get_mtq()
mf_get_breaks(x = mtq$MED, nbreaks = 6, breaks = "quantile")
}
\seealso{
\link[classInt:classIntervals]{classIntervals}
}
