% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tm_layers_cartogram.R
\name{tm_cartogram}
\alias{tm_cartogram}
\alias{tm_cartogram_ncont}
\alias{tm_cartogram_dorling}
\alias{opt_tm_cartogram}
\alias{opt_tm_cartogram_ncont}
\alias{opt_tm_cartogram_dorling}
\title{Map layer: cartogram}
\usage{
tm_cartogram(
  size = 1,
  size.scale = tm_scale(),
  size.legend = tm_legend_hide(),
  size.chart = tm_chart_none(),
  size.free = NA,
  plot.order = tm_plot_order("size", reverse = FALSE),
  options = opt_tm_cartogram(),
  ...
)

tm_cartogram_ncont(
  size = 1,
  size.scale = tm_scale(),
  size.legend = tm_legend_hide(),
  size.chart = tm_chart_none(),
  size.free = NA,
  plot.order = tm_plot_order("size", reverse = FALSE),
  options = opt_tm_cartogram_ncont(),
  ...
)

tm_cartogram_dorling(
  size = 1,
  size.scale = tm_scale(),
  size.legend = tm_legend_hide(),
  size.chart = tm_chart_none(),
  size.free = NA,
  plot.order = tm_plot_order("size", reverse = FALSE),
  options = opt_tm_cartogram_dorling(),
  ...
)

opt_tm_cartogram(type = "cont", itermax = 15, ...)

opt_tm_cartogram_ncont(type = "ncont", expansion = 1, inplace = FALSE, ...)

opt_tm_cartogram_dorling(type = "dorling", share = 5, itermax = 1000, ...)
}
\arguments{
\item{size, size.scale, size.legend, size.chart, size.free}{Visual variable that determines
the font size. See details.}

\item{plot.order}{Specification in which order the spatial features are drawn.
See \code{\link[=tm_plot_order]{tm_plot_order()}} for details.}

\item{options}{options passed on to the corresponding \verb{opt_<layer_function>} function}

\item{...}{
  Arguments passed on to \code{\link[=tm_polygons]{tm_polygons}}
  \describe{
    \item{\code{fill,fill.scale,fill.legend,fill.chart,fill.free}}{Visual variable that determines the fill color. See details.}
    \item{\code{col,col.scale,col.legend,col.chart,col.free}}{Visual variable that determines the border color. See details.}
    \item{\code{lwd,lwd.scale,lwd.legend,lwd.chart,lwd.free}}{Visual variable that determines the line width. See details.}
    \item{\code{lty,lty.scale,lty.legend,lty.chart,lty.free}}{Visual variable that determines the line type. See details.}
    \item{\code{fill_alpha,fill_alpha.scale,fill_alpha.chart,fill_alpha.legend,fill_alpha.free}}{Visual
variable that determines the fill color alpha transparency See details.}
    \item{\code{col_alpha,col_alpha.scale,col_alpha.legend,col_alpha.chart,col_alpha.free}}{Visual variable
that determines the border color alpha transparency. See details.}
    \item{\code{linejoin,lineend}}{Line join and line end. See \link[grid:gpar]{gpar()} for details.}
    \item{\code{zindex}}{Map layers are drawn on top of each other. The \code{zindex} numbers
(one for each map layer) determines the stacking order.
By default the map layers are drawn in the order they are called.}
    \item{\code{group}}{Name of the group to which this layer belongs. This is only
relevant in view mode, where layer groups can be switched (see \code{group.control})}
    \item{\code{group.control}}{In view mode, the group control determines how layer groups
can be switched on and off. Options: \code{"radio"} for radio buttons
(meaning only one group can be shown), \code{"check"} for check boxes
(so multiple groups can be shown), and \code{"none"} for no control
(the group cannot be (de)selected).}
    \item{\code{popup.vars}}{names of data variables that are shown in the popups
in \code{"view"} mode. Set popup.vars to \code{TRUE} to show all variables in the
shape object. Set popup.vars to \code{FALSE} to disable popups. Set \code{popup.vars}
to a character vector of variable names to those those variables in the popups.
The default (\code{NA}) depends on whether visual variables (e.g.\code{fill}) are used.
If so, only those are shown. If not all variables in the shape object are shown.}
    \item{\code{popup.format}}{list of formatting options for the popup values.
See the argument \code{legend.format} for options. Only applicable for
numeric data variables. If one list of formatting options is provided,
it is applied to all numeric variables of \code{popup.vars}. Also, a (named)
list of lists can be provided. In that case, each list of formatting options
is applied to the named variable.}
    \item{\code{hover}}{name of the data variable that specifies the hover labels (view mode only). Set to \code{FALSE} to disable hover labels. By default \code{FALSE}, unless \code{id} is specified. In that case, it is set to \code{id},}
    \item{\code{id}}{name of the data variable that specifies the indices of the spatial
features. Only used for \code{"view"} mode.}
  }}

\item{type}{cartogram type, one of: "cont" for contiguous cartogram, "ncont" for non-contiguous cartogram and "dorling" for Dorling cartograms}

\item{itermax, }{maximum number of iterations (see \code{\link[cartogram:cartogram_cont]{cartogram::cartogram_cont()}})}

\item{expansion}{factor expansion, see \code{\link[cartogram:cartogram_ncont]{cartogram::cartogram_ncont()}} (argument \code{k})}

\item{inplace}{should each polygon be modified in its original place? (\code{TRUE} by default)}

\item{share}{share of the bounding box filled with the larger circle (see \code{\link[cartogram:cartogram_dorling]{cartogram::cartogram_dorling()}} argument \code{k})}
}
\description{
Map layer that draws a cartogram
}
