% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mf_map.R
\name{mf_map}
\alias{mf_map}
\title{Plot a map}
\usage{
mf_map(x, var, type = "base",
       breaks, nbreaks, pal, alpha, rev, inches, val_max, symbol, col,
       lwd_max, val_order, pch, cex, border, lwd, col_na, cex_na, pch_na,
       expandBB, extent, bg, add,
       leg_pos, leg_title, leg_title_cex, leg_val_cex, leg_val_rnd,
       leg_val_dec, leg_val_big, leg_no_data, leg_frame, leg_frame_border,
       leg_horiz, leg_adj, leg_bg, leg_fg, leg_size,
       leg_box_border, leg_box_cex, ...)
}
\arguments{
\item{x}{object of class \code{sf}}

\item{var}{name(s) of the variable(s) to map}

\item{type}{\itemize{
\item \strong{\link[=mf_map_base]{base}}: base maps
\item \strong{\link[=mf_map_choro]{choro}}: choropleth maps
\item \strong{\link[=mf_map_typo]{typo}}: typology maps
\item \strong{\link[=mf_map_prop]{prop}}: proportional symbols maps
\item \strong{\link[=mf_map_prop_choro]{prop_choro}}: proportional symbols with choropleth
coloration
\item \strong{\link[=mf_map_prop_typo]{prop_typo}}: proportional symbols with typology
coloration
\item \strong{\link[=mf_map_symb]{symb}}: symbols maps
\item \strong{\link[=mf_map_grad]{grad}}: graduated symbols maps
\item \strong{\link[=mf_map_symb_choro]{symb_choro}}: symbols with choropleth coloration
}}

\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}.}

\item{alpha}{\code{col} or \code{pal} opacity, in the range [0,1] (0 means
transparent and 1 means opaque). Default is set to 1.}

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

\item{inches}{size of the largest symbol in inches (radius for circles,
half width for squares)}

\item{val_max}{maximum value corresponding to the largest symbol or line}

\item{symbol}{type of proportional symbols, either "circle" or "square"}

\item{col}{a color, hex code or color name given by \link{colors}}

\item{lwd_max}{width of the largest line}

\item{val_order}{modalities order in the legend, a character vector that
matches \code{var} modalities}

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

\item{cex}{symbols size, 2 means 2 times bigger}

\item{border}{border color for polygons or symbols. It can be a hex
code or a color name given by \link{colors}.}

\item{lwd}{border width of polygons, symbols or lines}

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

\item{cex_na}{symbols size for missing values on points}

\item{pch_na}{symbol to use for missing values on points, see \link{pch}}

\item{expandBB}{fractional values to expand the bounding box with, in each
direction (bottom, left, top, right)}

\item{extent}{object with an \code{st_bbox} method to define plot extent;
defaults to \code{x}. \code{extent} and \code{x} must use the same CRS.}

\item{bg}{background color of the map, hex code or color name given by
\link{colors}, ignored if \code{add = TRUE}}

\item{add}{whether to add the layer to an existing plot (TRUE) or not (FALSE)}

\item{leg_pos}{position of the legend, one of 'topleft', 'top','topright',
'right', 'bottomright', 'bottom', 'bottomleft', 'left' or a vector of two
coordinates in map units (c(x, y)). Use \code{NA} to avoid plotting the legend,
use 'interactive' to choose the legend position by clicking on the map.}

\item{leg_title}{legend title}

\item{leg_title_cex}{size of the title}

\item{leg_val_cex}{size of the values}

\item{leg_val_rnd}{number of decimal places of the values displayed in the
legend}

\item{leg_val_dec}{decimal separator}

\item{leg_val_big}{thousands separator}

\item{leg_no_data}{label for missing values}

\item{leg_frame}{whether to add a frame to the legend (TRUE) or not (FALSE)}

\item{leg_frame_border}{border color of the legend frame}

\item{leg_horiz}{display the legend horizontally (for proportional symbols
and choropleth types)}

\item{leg_adj}{adjust the position of the legend in x and y directions}

\item{leg_bg}{color of the legend background}

\item{leg_fg}{color of the legend foreground}

\item{leg_size}{size of the legend. Combine this argument with
\code{leg_title_cex} and \code{leg_val_cex}.}

\item{leg_box_border}{border color of legend boxes (for types related to
choropleth and typology)}

\item{leg_box_cex}{width and height size expansion of boxes}

\item{...}{ignored}
}
\value{
x is (invisibly) returned.
}
\description{
\code{mf_map()} is the main function of the package, it displays map layers on a
georeferenced plot.

\code{mf_map()} has three main arguments:
\itemize{
\item \code{x}, an sf object,
\item \code{var}, the name(s) of a variable(s) to map,
\item \code{type}, the map type.
}

Relevant arguments and default values are different for each map type and are
described in dedicated help pages (see \link[=mf_map_base]{base},
\link[=mf_map_choro]{choro}, \link[=mf_map_typo]{typo}, \link[=mf_map_prop]{prop},
\link[=mf_map_prop_choro]{prop_choro}, \link[=mf_map_prop_typo]{prop_typo},
\link[=mf_map_symb]{symb}, \link[=mf_map_grad]{grad} or \link[=mf_map_symb_choro]{symb_choro}).
}
\examples{
mtq <- mf_get_mtq()
# basic examples
# type = "base"
mf_map(mtq)
# type = "prop"
mf_map(mtq)
mf_map(mtq, var = "POP", type = "prop")
# type = "choro"
mf_map(mtq, var = "MED", type = "choro")
# type = "typo"
mf_map(mtq, "STATUS", "typo")
# type = "symb"
mf_map(mtq)
mf_map(mtq, "STATUS", "symb")
# type = "grad"
mf_map(mtq)
mf_map(mtq, var = "POP", type = "grad")
# type = "prop_choro"
mf_map(mtq)
mf_map(mtq, var = c("POP", "MED"), type = "prop_choro")
# type = "prop_typo"
mf_map(mtq)
mf_map(mtq, var = c("POP", "STATUS"), type = "prop_typo")
# type = "symb_choro
mf_map(mtq)
mf_map(mtq, var = c("STATUS", "MED"), type = "symb_choro")
}
\concept{map types}
