% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mf_map_help.R
\name{mf_map_choro}
\alias{mf_map_choro}
\title{Plot a choropleth map}
\arguments{
\item{x}{object of class \code{sf}}

\item{var}{name of the variable to map}

\item{type}{"choro"}

\item{breaks}{either a numeric vector with the actual breaks, or a
classification method name. The main methods are 'quantile',
'equal', 'msd', 'ckmeans' (natural breaks), 'Q6' and 'geom'.
See \link{mf_get_breaks} for details.}

\item{nbreaks}{number of classes}

\item{pal}{a set of colors (hex codes) or a palette name. Palette names can
be obtained with \link{hcl.pals}. The default palette is the pal_seq palette
(see \link{mf_theme}).}

\item{rev}{if \code{pal} is a palette name, whether the ordering of the colors
should be reversed (TRUE) or not (FALSE)}

\item{border}{border color for polygons and symbols, a hex code or
color name given by \link{colors}. The default color for polygons is the
highlight color, the default color for points is the background color (see
\link{mf_theme}).}

\item{lwd}{border width for polygons and points symbols, lines width}

\item{pch}{type of symbol to use for points, see \link{pch} (points only)}

\item{cex}{symbols size, 2 means 2 times bigger (points only)}

\item{col_na}{color for missing values, a hex code or
a color name given by \link{colors}.}

\item{alpha, expandBB, extent, bg, add}{arguments described in \link{mf_map}}

\item{leg_*}{legend arguments described in \link{mf_map}}
}
\value{
x is (invisibly) returned.
}
\description{
With the \strong{choro} map type, \code{mf_map()} displays a choropleth map.

In choropleth maps, areas are shaded according to the variation of a
quantitative variable. They are used to represent ratios or indices.
\subsection{Usage}{

For polygons:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{mf_map(x, var, type = "choro",
       breaks = "quantile", nbreaks, pal, rev = FALSE,
       border, lwd = 0.7, col_na = "white",
       alpha, expandBB, extent, bg, add = FALSE, leg_*)
}\if{html}{\out{</div>}}

For points:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{mf_map(x, var, type = "choro",
       breaks = "quantile", nbreaks, pal, rev = FALSE,
       border, pch = 21, cex = 2, lwd = 0.7, col_na = "white",
       alpha, expandBB, extent, bg, add = FALSE, leg_*)
}\if{html}{\out{</div>}}

For lines:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{mf_map(x, var, type = "choro",
       breaks = "quantile", nbreaks, pal, rev = FALSE, lwd = .7,
       col_na = "white",
       alpha, expandBB, extent, bg, add = FALSE, leg_*)
}\if{html}{\out{</div>}}
}
}
\examples{
mtq <- mf_get_mtq()
pts <- mf_get_mtq("points")
flows <- mf_get_mtq("lines")
# polygons
mtq[6, "MED"] <- NA
mf_map(
  x = mtq, var = "MED", type = "choro",
  col_na = "grey90", pal = "Cividis",
  breaks = "equal", nbreaks = 5, border = "white",
  lwd = .5, leg_pos = "topleft",
  leg_title = "Median Income", leg_title_cex = 1,
  leg_val_cex = .9, leg_val_rnd = -2, leg_no_data = "No data",
  leg_box_cex = c(0.5, 3), leg_box_border = NA, leg_frame = FALSE
)
# points
mf_map(mtq)
mf_map(
  x = pts, var = "MED", type = "choro",
  pch = 21, cex = 3, lwd = 1.2,
  pal = "Teal", border = "white",
  leg_horiz = FALSE, leg_val_big = " ",
  leg_val_rnd = -2, leg_pos = "topright",
  leg_frame = TRUE, add = TRUE
)
# lines
mf_map(mtq, extent = flows)
mf_map(
  x = flows, var = "fij", type = "choro",
  breaks = "equal", nbreaks = 3, add = TRUE,
  lwd = 5, pal = "Burg", leg_horiz = TRUE,
  leg_box_cex = c(.7, 1),
  leg_val_rnd = 0, leg_pos = "bottomleft"
)
}
\seealso{
\code{\link[=mf_map]{mf_map()}}, \code{\link[=mf_distr]{mf_distr()}}, \code{\link[=mf_get_breaks]{mf_get_breaks()}}, \code{\link[=mf_get_pal]{mf_get_pal()}}
}
