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

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

\item{type}{"choro"}

\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_quali 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{val_order}{modalities order in the legend, a character vector that
matches \code{var} modalities. Default to alphabetic order of modalities.}

\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{typo} map type, \code{mf_map()} displays a typology map.

In typology maps, areas are shaded according to the modalities of a
qualitative variable.
\subsection{Usage}{

For polygons:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{mf_map(x, var, type = "typo",
       pal, rev = FALSE, val_order,
       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 = "typo",
       pal, rev = FALSE, val_order,
       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 = "typo",
       pal, rev = FALSE, val_order, 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, "STATUS"] <- NA
mf_map(
  x = mtq, var = "STATUS", type = "typo",
  col_na = "grey90", border = "white",
  pal = c("#FFE93F", "#00214E", "#7C7C7C"),
  val_order = c("Prefecture", "Sub-prefecture", "Simple municipality"),
  lwd = .5, leg_pos = "bottomleft",
  leg_title = "", leg_title_cex = 1,
  leg_val_cex = .9, leg_no_data = "No data",
  leg_box_cex = c(0.5, 3), leg_box_border = NA
)
# points
mf_map(
  x = pts, var = "STATUS", type = "typo",
  cex = 3, pal = "Dark 3", border = "grey",
  leg_pos = "bottomleft"
)
# lines
mf_map(mtq, extent = flows)
mf_map(
  x = flows, var = "sj", type = "typo",
  add = TRUE,
  lwd = 2, pal = c("red", "blue"),
  leg_pos = "bottomleft"
)
}
\seealso{
\code{\link[=mf_map]{mf_map()}}, \code{\link[=mf_get_pal]{mf_get_pal()}}
}
