diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index d0fb1176..be3a0465 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: tmap_sneak_peek: tmap_sneak_peek.html tmap_vv: tmap_vv.html -last_built: 2023-09-21T06:27Z +last_built: 2023-09-21T06:34Z urls: reference: https://r-tmap.github.io/tmap/reference article: https://r-tmap.github.io/tmap/articles diff --git a/dev/reference/Shapes.html b/dev/reference/Shapes.html index 61d670d3..f65e7f3d 100644 --- a/dev/reference/Shapes.html +++ b/dev/reference/Shapes.html @@ -1,5 +1,7 @@ -World and Netherlands map — World • tmapWorld and Netherlands map — World • tmap @@ -53,7 +55,8 @@
-

Maps of the world and the Netherlands (province and municipality level), class sf

+

Maps of the world and the Netherlands (province and municipality level), +class sf

@@ -73,10 +76,15 @@

Source<

Details

-

The default projections for these maps are Eckhart IV (World) and Rijksdriehoekstelsel (Netherlands). See below. The projection can be changed temporarily for plotting purposes by using the projection argument of tm_shape().

-

World World map. The default projection for this world map is Eckhart IV since area sizes are preserved, which is a very important property for choropleths.

-

NLD_prov and NLD_muni, maps of the Netherlands at province and municipality level of 2013. The used projection is the Rijksdriehoekstelsel projection.

-

Important: publication of these maps is only allowed when citing Statistics Netherlands (CBS) and Kadaster Nederland as source.

+

The default projections for these maps are Eckhart IV (World) and +Rijksdriehoekstelsel (Netherlands). See below. The projection can be changed +temporarily for plotting purposes by using the projection argument of tm_shape().

+

World World map. The default projection for this world map is Eckhart IV +since area sizes are preserved, which is a very important property for choropleths.

+

NLD_prov and NLD_muni, maps of the Netherlands at province and municipality +level of 2013. The used projection is the Rijksdriehoekstelsel projection.

+

Important: publication of these maps is only allowed when citing +Statistics Netherlands (CBS) and Kadaster Nederland as source.

References

diff --git a/dev/reference/qtm.html b/dev/reference/qtm.html index dc09ff39..517a62ac 100644 --- a/dev/reference/qtm.html +++ b/dev/reference/qtm.html @@ -1,5 +1,9 @@ -Quick thematic map plot — qtm • tmapQuick thematic map plot — qtm • tmap @@ -53,7 +57,9 @@
-

Draw a thematic map quickly. This function is a convenient wrapper of the main plotting method of stacking tmap-elements. Without arguments or with a search term, this functions draws an interactive map.

+

Draw a thematic map quickly. This function is a convenient wrapper of the main +plotting method of stacking tmap-elements. Without arguments or with a +search term, this functions draws an interactive map.

@@ -87,9 +93,14 @@

Usage

Arguments

shp
-

One of

  • shape object, which is an object from a class defined by the sf or stars package. Objects from the packages sp and raster are also supported, but discouraged.

  • -
  • Not specified, i.e. qtm() is executed. In this case a plain interactive map is shown.

  • -
  • An OpenStreetMap search string, e.g. qtm("Amsterdam"). In this case a plain interactive map is shown positioned according to the results of the search query (from OpenStreetMap nominatim)

  • +

    One of:

    • shape object, which is an object from a class defined by the sf +or stars package. Objects from the packages sp +and raster are also supported, but discouraged.

    • +
    • Not specified, i.e. qtm() is executed. In this case a plain interactive +map is shown.

    • +
    • An OpenStreetMap search string, e.g. qtm("Amsterdam"). In this case a +plain interactive map is shown positioned according to the results of the +search query (from OpenStreetMap nominatim)

    @@ -98,19 +109,28 @@

    Argumentstm_facets()

+

data variable name by which the data is split, or a vector of two +variable names to split the data by two variables (where the first is used +for the rows and the second for the columns). See also tm_facets().

scale
-

numeric value that serves as the global scale parameter. All font sizes, symbol sizes, border widths, and line widths are controlled by this value. The parameters symbols.size, text.size, and lines.lwd can be scaled separately with respectively symbols.scale, text.scale, and lines.scale. See also ....

+

numeric value that serves as the global scale parameter. All font +sizes, symbol sizes, border widths, and line widths are controlled by this value. +The parameters symbols.size, text.size, and lines.lwd can be scaled +separately with respectively symbols.scale, text.scale, and +lines.scale. See also ....

title
-

main title. For legend titles, use X.style, where X is the layer name (see ...).

+

main title. For legend titles, use X.style, where X is the +layer name (see ...).

crs
-

Either a crs object or a character value (PROJ.4 character string). By default, the projection is used that is defined in the shp object itself.

+

Either a crs object or a character value +(PROJ.4 character string). By default, the projection is used that is +defined in the shp object itself.

bbox
@@ -118,11 +138,14 @@

Argumentstm_basemap(). Set to NULL to disable basemaps. By default, it is set to the tmap option basemaps.

+

name(s) of the provider or an URL of a tiled basemap. +It is a shortcut to tm_basemap(). Set to NULL to disable basemaps. +By default, it is set to the tmap option basemaps.

overlays
-

name(s) of the provider or an URL of a tiled overlay map. It is a shortcut to tm_tiles().

+

name(s) of the provider or an URL of a tiled overlay map. +It is a shortcut to tm_tiles().

zindex
@@ -138,15 +161,24 @@

Argumentstm_layout()) that define the style. See tmap_style() for details.

+

Layout options (see tm_layout()) that define the style. +See tmap_style() for details.

format
-

Layout options (see tm_layout()) that define the format. See tmap_format() for details.

+

Layout options (see tm_layout()) that define the format. +See tmap_format() for details.

...
-

arguments passed on to the tm_* functions. The prefix of these arguments should be with the layer function name without "tm_" and a period. For instance, the palette for polygon fill color is called fill.palette. The following prefixes are supported: shape., fill., borders., polygons., symbols., dots., lines., raster., text., layout., grid., facets., and view.. Arguments that have a unique name, i.e. that does not exist in any other layer function, e.g. convert2density, can also be called without prefix.

+

arguments passed on to the tm_* functions. The prefix of these +arguments should be with the layer function name without "tm_" and a period. +For instance, the palette for polygon fill color is called fill.palette. +The following prefixes are supported: shape., fill., borders., polygons., +symbols., dots., lines., raster., text., layout., grid., +facets., and view.. Arguments that have a unique name, i.e. that does +not exist in any other layer function, e.g. convert2density, can also be +called without prefix.

@@ -159,12 +191,20 @@

Value

Details

-

The first argument is a shape object (normally specified by tm_shape()). The next arguments, from fill to raster, are the aesthetics from the main layers. The remaining arguments are related to the map layout. Any argument from any main layer function, such as tm_polygons(), can be specified (see ...). It is also possible to stack tmap-elements on a qtm plot. See examples.

-

By default, a scale bar is shown. This option can be set with tmap_options() (argument qtm.scalebar). A minimap is shown by default when qtm is called without arguments of with a search term. This option can be set with tmap_options() (argument qtm.minimap).

+

The first argument is a shape object (normally specified by tm_shape()). +The next arguments, from fill to raster, are the aesthetics from the main +layers. The remaining arguments are related to the map layout. Any argument +from any main layer function, such as tm_polygons(), can be specified (see ...). +It is also possible to stack tmap-elements on a qtm plot. See examples.

+

By default, a scale bar is shown. This option can be set with tmap_options() +(argument qtm.scalebar). A minimap is shown by default when qtm is called +without arguments of with a search term. This option can be set with tmap_options() +(argument qtm.minimap).

References

-

Tennekes, M., 2018, tmap: Thematic Maps in R, Journal of Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06

+

Tennekes, M., 2018, tmap: Thematic Maps in R, +Journal of Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06

See also

diff --git a/dev/reference/theme_ps.html b/dev/reference/theme_ps.html index cf7685ff..7abdd3cc 100644 --- a/dev/reference/theme_ps.html +++ b/dev/reference/theme_ps.html @@ -1,5 +1,7 @@ -ggplot2 theme for proportional symbols — theme_ps • tmapggplot2 theme for proportional symbols — theme_ps • tmap @@ -53,7 +55,8 @@
-

ggplot2 theme for proportional symbols. By default, this theme only shows the plotting area, so without titles, axes, and legend

+

ggplot2 theme for proportional symbols. By default, this theme only shows the +plotting area, so without titles, axes, and legend.

diff --git a/dev/reference/tm_add_legend.html b/dev/reference/tm_add_legend.html index 30d572fc..b2831e2b 100644 --- a/dev/reference/tm_add_legend.html +++ b/dev/reference/tm_add_legend.html @@ -75,7 +75,10 @@

Usage

Arguments

...
-

visual variables and arguments passed on to tm_legend. By default, the argument type is set to "Symbols", which means that the supported visual variables are: "fill", "col", "shape", "size", "fill_alpha", "col_alpha", "lty", "lwd", "linejoin", and "lineend".

+

visual variables and arguments passed on to tm_legend(). +By default, the argument type is set to "Symbols", which means that the +supported visual variables are: "fill", "col", "shape", "size", +"fill_alpha", "col_alpha", "lty", "lwd", "linejoin", and "lineend".

labels
@@ -83,7 +86,8 @@

Arguments (default), "Lines", "Polygons", and "Text".

+

the layer type from which the visual variables (see ...) are taken. +Options: "Symbols" (default), "Lines", "Polygons", and "Text".

title
@@ -99,11 +103,16 @@

Arguments for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how +layer groups can be switched on and off. Options: "radio" for radio +buttons (meaning only one group can be shown), "check" for check boxes +(so multiple groups can be shown), and "none" for no control +(the group cannot be (de)selected).

resize.as.group
diff --git a/dev/reference/tm_basemap.html b/dev/reference/tm_basemap.html index ba31c37a..f023ff05 100644 --- a/dev/reference/tm_basemap.html +++ b/dev/reference/tm_basemap.html @@ -1,5 +1,11 @@ -Map layer: basemap / overlay tiles — tm_basemap • tmapMap layer: basemap / overlay tiles — tm_basemap • tmap @@ -53,7 +59,10 @@

-

Map layer that draws tiles from a tile server. tm_basemap() draws the tile layer as basemap, i.e. as bottom layer. In contrast, tm_tiles() draws the tile layer as overlay layer, where the stacking order corresponds with the order in which this layer is called, just like other map layers.

+

Map layer that draws tiles from a tile server. tm_basemap() draws the tile +layer as basemap, i.e. as bottom layer. In contrast, tm_tiles() draws the +tile layer as overlay layer, where the stacking order corresponds with the +order in which this layer is called, just like other map layers.

@@ -80,7 +89,12 @@

Usage

Arguments

server
-

Name of the provider or an URL. The list of available providers can be obtained with providers (tip: in RStudio, type providers$ to see the options). See https://leaflet-extras.github.io/leaflet-providers/preview/ for a preview of those. When a URL is provided, it should be in template format, e.g. "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png". Use NULL in tm_basemap() to disable basemaps.

+

Name of the provider or an URL. The list of available providers +can be obtained with providers (tip: in RStudio, type providers$ to see +the options). See https://leaflet-extras.github.io/leaflet-providers/preview/ +for a preview of those. When a URL is provided, it should be in template format, +e.g. "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png". +Use NULL in tm_basemap() to disable basemaps.

alpha
@@ -92,15 +106,26 @@

Arguments, "tmap402", etc., except for the base tile layers, which are placed in the standard "tile". This parameter determines both the name of the pane and the z-index, which determines the pane order from bottom to top. For instance, if zindex is set to 500, the pane will be named "tmap500".

+

zindex of the pane in view mode. By default, it is set to the +layer number plus 400. By default, the tmap layers will therefore be placed +in the custom panes "tmap401", "tmap402", etc., except for the base tile +layers, which are placed in the standard "tile". This parameter determines +both the name of the pane and the z-index, which determines the pane order +from bottom to top. For instance, if zindex is set to 500, the pane will +be named "tmap500".

group
-

Name of the group to which this layer belongs. This is only relevant in view mode, where layer groups can be switched (see group.control)

+

Name of the group to which this layer belongs. This is only +relevant in view mode, where layer groups can be switched (see group.control)

group.control
-

In view mode, the group control determines how layer groups can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how layer +groups can be switched on and off. Options: "radio" for radio buttons +(meaning only one group can be shown), "check" for check boxes +(so multiple groups can be shown), and "none" for no control +(the group cannot be (de)selected).

diff --git a/dev/reference/tm_cartogram.html b/dev/reference/tm_cartogram.html index 0897a498..199d1468 100644 --- a/dev/reference/tm_cartogram.html +++ b/dev/reference/tm_cartogram.html @@ -72,11 +72,13 @@

Usage

Arguments

size, size.scale, size.legend, size.free
-

Transformation variable that determines the size of the polygons.

+

Transformation variable that +determines the size of the polygons.

plot.order
-

Specification in which order the spatial features are drawn. See tm_plot_order() for details.

+

Specification in which order the spatial features are drawn. +See tm_plot_order() for details.

trans.args
@@ -97,37 +99,58 @@

Argumentsgpar() for details.

trans.args,mapping.args
-

lists that are passed on to internal transformation and mapping functions respectively

+

lists that are passed on to internal transformation +and mapping functions respectively.

zindex
-

Map layers are drawn on top of each other. The zindex numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.

+

Map layers are drawn on top of each other. The zindex numbers +(one for each map layer) determines the stacking order. +By default the map layers are drawn in the order they are called.

group
-

Name of the group to which this layer belongs. This is only relevant in view mode, where layer groups can be switched (see group.control)

+

Name of the group to which this layer belongs. This is only +relevant in view mode, where layer groups can be switched (see group.control)

group.control
-

In view mode, the group control determines how layer groups can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how layer groups +can be switched on and off. Options: "radio" for radio buttons +(meaning only one group can be shown), "check" for check boxes +(so multiple groups can be shown), and "none" for no control +(the group cannot be (de)selected).

popup.vars
-

names of data variables that are shown in the popups in "view" mode. Set popup.vars to TRUE to show all variables in the shape object. Set popup.vars to FALSE to disable popups. Set popup.vars to a character vector of variable names to those those variables in the popups. The default (NA) depends on whether visual variables (e.g.col) are used. If so, only those are shown. If not all variables in the shape object are shown.

+

names of data variables that are shown in the popups +in "view" mode. Set popup.vars to TRUE to show all variables in the +shape object. Set popup.vars to FALSE to disable popups. Set popup.vars +to a character vector of variable names to those those variables in the popups. +The default (NA) depends on whether visual variables (e.g.fill) are used. +If so, only those are shown. If not all variables in the shape object are shown.

popup.format
-

list of formatting options for the popup values. See the argument 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 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.

+

list of formatting options for the popup values. +See the argument 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 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.

hover

name of the data variable that specifies the hover labels

id
-

name of the data variable that specifies the indices of the spatial features. Only used for "view" mode.

+

name of the data variable that specifies the indices of the spatial +features. Only used for "view" mode.

diff --git a/dev/reference/tm_facets.html b/dev/reference/tm_facets.html index 3d79fc68..973518ec 100644 --- a/dev/reference/tm_facets.html +++ b/dev/reference/tm_facets.html @@ -1,5 +1,15 @@ -Facets — tm_facets • tmapFacets — tm_facets • tmap @@ -53,7 +63,12 @@
-

Specify facets. tm_facets() is the core function, but recommended is to use tm_facets_wrap(), tm_facets_stack() or tm_facets_grid(). The former two specify facets for one grouping variable (so one faceting dimension). The difference is that wrap may place facets in multiple rows and columns whereas tm_facets_stack() stacks the facets either horizontally or vertically. tm_facets_grid() supports up to three faceting dimensions.

+

Specify facets. tm_facets() is the core function, but recommended is to use +tm_facets_wrap(), tm_facets_stack() or tm_facets_grid(). +The former two specify facets for one grouping variable (so one faceting dimension). +The difference is that wrap may place facets in multiple rows and columns whereas +tm_facets_stack() stacks the facets either horizontally or vertically. +tm_facets_grid() supports up to three faceting dimensions.

@@ -134,27 +149,45 @@

Argumentstable(), where TRUE, FALSE, and NA correspond to "always", "no", and "ifany" respectively.

+

If the by argument is specified, should missing values of the +by-variable be shown in a facet? If two by-variables are specified, +should missing values be shown in an additional row and column? +If NA, missing values only are shown if they exist. Similar to the +useNA argument of table(), where TRUE, FALSE, +and NA correspond to "always", "no", and "ifany" respectively.

textNA
@@ -162,7 +195,13 @@

ArgumentsCoordinate grid / graticule lines — tm_graticules • tmapCoordinate grid / graticule lines — tm_graticules • tmap @@ -53,7 +61,11 @@

-

Creates a tmap-element that draws coordinate grid lines. It serves as a layer that can be drawn anywhere between other layers. By default, tm_grid() draws horizontal and vertical lines according to the coordinate system of the (master) shape object. Latitude and longitude graticules are drawn with tm_graticules().

+

Creates a tmap-element that draws coordinate grid lines. It serves as a +layer that can be drawn anywhere between other layers. +By default, tm_grid() draws horizontal and vertical lines according to the +coordinate system of the (master) shape object. Latitude and longitude +graticules are drawn with tm_graticules().

@@ -103,37 +115,53 @@

Usage

Arguments

x
-

X coordinates for vertical grid lines. If NA, it is specified with a pretty scale and n.x.

+

X coordinates for vertical grid lines. If NA, it is specified +with a pretty scale and n.x.

y
-

Y coordinates for horizontal grid lines. If NA, it is specified with a pretty scale and n.y.

+

Y coordinates for horizontal grid lines. If NA, it is specified +with a pretty scale and n.y.

n.x
-

Preferred number of grid lines for the x axis. For the labels, a pretty() sequence is used, so the number of actual labels may be different than n.x.

+

Preferred number of grid lines for the x axis. For the labels, +a pretty() sequence is used, so the number of actual labels may be different than n.x.

n.y
-

Preferred number of grid lines for the y axis. For the labels, a pretty() sequence is used, so the number of actual labels may be different than n.y.

+

Preferred number of grid lines for the y axis. For the labels, a +pretty() sequence is used, so the number of actual labels may be different than n.y.

crs
-

Projection character. If specified, the grid lines are projected accordingly. Many world maps are projected, but still have latitude longitude (EPSG 4326) grid lines.

+

Projection character. If specified, the grid lines are projected +accordingly. Many world maps are projected, but still have latitude longitude +(EPSG 4326) grid lines.

labels.format

List of formatting options for the grid labels. Parameters are:

fun
-

Function to specify the labels. It should take a numeric vector, and should return a character vector of the same size. By default it is not specified. If specified, the list items scientific, format, and digits (see below) are not used.

+

Function to specify the labels. It should take a numeric vector, +and should return a character vector of the same size. +By default it is not specified. If specified, the list items scientific, +format, and digits (see below) are not used.

scientific
-

Should the labels be formatted scientifically? If so, square brackets are used, and the format of the numbers is "g". Otherwise, format="f", and text.separator, text.less.than, and text.or.more are used. Also, the numbers are automatically rounded to millions or billions if applicable.

+

Should the labels be formatted scientifically? +If so, square brackets are used, and the format of the numbers is "g". +Otherwise, format="f", and text.separator, text.less.than, and +text.or.more are used. Also, the numbers are automatically rounded to +millions or billions if applicable.

format
-

By default, "f", i.e. the standard notation xxx.xxx, is used. If scientific=TRUE then "g", which means that numbers are formatted scientifically, i.e. n.dddE+nn if needed to save space.

+

By default, "f", i.e. the standard notation xxx.xxx, is used. +If scientific=TRUE then "g", which means that numbers are formatted scientifically, +i.e. n.dddE+nn if needed to save space.

digits
-

Number of digits after the decimal point if format="f", and the number of significant digits otherwise.

+

Number of digits after the decimal point if format="f", and +the number of significant digits otherwise.

...

Other arguments passed on to formatC()

@@ -143,7 +171,9 @@

ArgumentsArguments

+

position of the labels. Vector of two: the horizontal +("left" or "right") and the vertical ("top" or "bottom") position.

labels.size
@@ -179,31 +212,43 @@

ArgumentsArguments, "tmap402", etc., except for the base tile layers, which are placed in the standard "tile". This parameter determines both the name of the pane and the z-index, which determines the pane order from bottom to top. For instance, if zindex is set to 500, the pane will be named "tmap500".

+

zindex of the pane in view mode. By default, it is set to the +layer number plus 400. By default, the tmap layers will therefore be placed +in the custom panes "tmap401", "tmap402", etc., except for the base tile +layers, which are placed in the standard "tile". This parameter determines +both the name of the pane and the z-index, which determines the pane order +from bottom to top. For instance, if zindex is set to 500, +the pane will be named "tmap500".

group
-

Name of the group to which this layer belongs. This is only relevant in view mode, where layer groups can be switched (see group.control)

+

Name of the group to which this layer belongs. +This is only relevant in view mode, where layer groups can be +switched (see group.control)

group.control
-

In view mode, the group control determines how layer groups can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how layer groups +can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), +"check" for check boxes (so multiple groups can be shown), and "none" +for no control (the group cannot be (de)selected).

diff --git a/dev/reference/tm_layout.html b/dev/reference/tm_layout.html index 0f165a4f..186d94c6 100644 --- a/dev/reference/tm_layout.html +++ b/dev/reference/tm_layout.html @@ -319,7 +319,7 @@

Usage

Arguments

modes, crs, facet.max, facet.flip, raster.max.cells, show.messages, show.warnings, output.format, output.size, output.dpi, output.dpi.animation, value.const, value.na, value.null, value.blank, values.var, values.range, value.neutral, scales.var, scale.misc.args, label.format, label.na, scale, asp, bg.color, outer.bg.color, frame, frame.lwd, frame.r, frame.double.line, outer.margins, inner.margins, inner.margins.extra, meta.margins, meta.auto.margins, between.margin, component.offset, component.stack.margin, grid.mark.height, xylab.height, coords.height, xlab.show, xlab.text, xlab.size, xlab.color, xlab.rotation, xlab.space, xlab.fontface, xlab.fontfamily, xlab.side, ylab.show, ylab.text, ylab.size, ylab.color, ylab.rotation, ylab.space, ylab.fontface, ylab.fontfamily, ylab.side, panel.type, panel.wrap.pos, panel.xtab.pos, unit, color.sepia.intensity, color.saturation, color.vision.deficiency.sim, text.fontface, text.fontfamily, legend.show, legend.design, legend.orientation, legend.position, legend.width, legend.height, legend.stack, legend.group.frame, legend.resize.as.group, legend.reverse, legend.na.show, legend.title.color, legend.title.size, legend.title.fontface, legend.title.fontfamily, legend.xlab.color, legend.xlab.size, legend.xlab.fontface, legend.xlab.fontfamily, legend.ylab.color, legend.ylab.size, legend.ylab.fontface, legend.ylab.fontfamily, legend.text.color, legend.text.size, legend.text.fontface, legend.text.fontfamily, legend.frame, legend.frame.lwd, legend.frame.r, legend.bg.color, legend.bg.alpha, legend.settings.standard.portrait, legend.settings.standard.landscape, title.show, title.size, title.color, title.fontface, title.fontfamily, title.bg.color, title.bg.alpha, title.padding, title.frame, title.frame.lwd, title.frame.r, title.stack, title.position, title.group.frame, title.resize.as.group, credits.show, credits.size, credits.color, credits.fontface, credits.fontfamily, credits.bg.color, credits.bg.alpha, credits.padding, credits.frame, credits.frame.lwd, credits.frame.r, credits.stack, credits.position, credits.width, credits.heigth, credits.group.frame, credits.resize.as.group, compass.north, compass.type, compass.text.size, compass.size, compass.show.labels, compass.cardinal.directions, compass.text.color, compass.color.dark, compass.color.light, compass.lwd, compass.bg.color, compass.bg.alpha, compass.margins, compass.show, compass.stack, compass.position, compass.frame, compass.frame.lwd, compass.frame.r, compass.group.frame, compass.resize.as.group, scalebar.show, scalebar.breaks, scalebar.width, scalebar.text.size, scalebar.text.color, scalebar.color.dark, scalebar.color.light, scalebar.lwd, scalebar.position, scalebar.bg.color, scalebar.bg.alpha, scalebar.size, scalebar.margins, scalebar.stack, scalebar.frame, scalebar.frame.lwd, scalebar.frame.r, scalebar.group.frame, scalebar.resize.as.group, grid.show, grid.labels.pos, grid.x, grid.y, grid.n.x, grid.n.y, grid.crs, grid.col, grid.lwd, grid.alpha, grid.labels.show, grid.labels.size, grid.labels.col, grid.labels.rot, grid.labels.format, grid.labels.cardinal, grid.labels.margin.x, grid.labels.margin.y, grid.labels.space.x, grid.labels.space.y, grid.labels.inside.frame, grid.ticks, grid.lines, grid.ndiscr, mouse_coordinates.stack, mouse_coordinates.position, mouse_coordinates.show, panel.show, panel.labels, panel.label.size, panel.label.color, panel.label.fontface, panel.label.fontfamily, panel.label.bg.color, panel.label.height, panel.label.rot, qtm.scalebar, qtm.minimap, qtm.mouse.coordinates, earth.boundary, earth.boundary.color, earth.boundary.lwd, earth.datum, space.color, attr.color, max.categories, legend.hist.bg.color, legend.hist.bg.alpha, legend.hist.size, legend.hist.height, legend.hist.width, attr.outside, attr.outside.position, attr.outside.size, attr.position, attr.just, basemap.server, basemap.alpha, basemap.zoom, overlays, overlays.alpha, alpha, colorNA, symbol.size.fixed, dot.size.fixed, text.size.variable, bbox, check.and.fix, set.bounds, set.view, set.zoom.limits, name, basemap.show
-

seetmap_options()

+

See tmap_options()

title, main.title
diff --git a/dev/reference/tm_plot_order.html b/dev/reference/tm_plot_order.html index 0affa778..fd899068 100644 --- a/dev/reference/tm_plot_order.html +++ b/dev/reference/tm_plot_order.html @@ -70,15 +70,29 @@

Usage

Arguments

aes
-

Visual variable for which the values determine the plotting order. Example: bubble map where the "size" aesthetic is used. A data variable (say population) is mapped via a continuous scale (tm_scale_continuous()) to bubble sizes. The bubbles are plotted in order of size. How is determined by the other arguments. Use "DATA" to keep the same order as in the data. Another special value are "AREA" and "LENGTH" which are preserved for polygons and lines respectively: rather than a data variable the polygon area / line lengths determines the plotting order.

+

Visual variable for which the values determine the plotting order. +Example: bubble map where the "size" aesthetic is used. +A data variable (say population) is mapped via a continuous scale (tm_scale_continuous()) +to bubble sizes. The bubbles are plotted in order of size. +How is determined by the other arguments. Use "DATA" to keep the same +order as in the data. Another special value are "AREA" and "LENGTH" +which are preserved for polygons and lines respectively: rather than a data +variable the polygon area / line lengths determines the plotting order.

reverse
-

Logical that determines whether the visual values are plotted in reversed order. The visual values (specified with tmap option "values.var") are by default reversed, so plotted starting from the last value. In the bubble map example, this means that large bubbles are plotted first, hence at the bottom.

+

Logical that determines whether the visual values are plotted +in reversed order. The visual values (specified with tmap option "values.var") +are by default reversed, so plotted starting from the last value. +In the bubble map example, this means that large bubbles are plotted first, +hence at the bottom.

na.order
-

Where should features be plotted that have an NA value for (at least) one other aesthetic variable? In the (order) "mix", at the "bottom", or on "top"? In the bubble map example: if fill color is missing for some bubble, where should those bubbles be plotted?

+

Where should features be plotted that have an NA value for +(at least) one other aesthetic variable? In the (order) "mix", at the "bottom", +or on "top"? In the bubble map example: if fill color is missing for some bubble, +where should those bubbles be plotted?

null.order
diff --git a/dev/reference/tm_polygons.html b/dev/reference/tm_polygons.html index 79ba1c82..23fa911f 100644 --- a/dev/reference/tm_polygons.html +++ b/dev/reference/tm_polygons.html @@ -1,5 +1,9 @@ -Map layer: polygons — tm_polygons • tmapMap layer: polygons — tm_polygons • tmap @@ -53,7 +57,9 @@
-

Map layer that draws polygons. Supported visual variables are: fill (the fill color), col (the border color), lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) and col_alpha (border color alpha transparency).

+

Map layer that draws polygons. Supported visual variables are: fill (the fill color), +col (the border color), lwd (line width), lty (line type), +fill_alpha (fill color alpha transparency) and col_alpha (border color alpha transparency).

@@ -122,11 +128,13 @@

ArgumentsArgumentstm_plot_order() for details.

+

Specification in which order the spatial features are drawn. +See tm_plot_order() for details.

trans.args, mapping.args
-

lists that are passed on to internal transformation and mapping functions respectively

+

lists that are passed on to internal transformation +and mapping functions respectively.

zindex
-

Map layers are drawn on top of each other. The zindex numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.

+

Map layers are drawn on top of each other. The zindex numbers +(one for each map layer) determines the stacking order. +By default the map layers are drawn in the order they are called.

group
-

Name of the group to which this layer belongs. This is only relevant in view mode, where layer groups can be switched (see group.control)

+

Name of the group to which this layer belongs. This is only +relevant in view mode, where layer groups can be switched (see group.control)

group.control
-

In view mode, the group control determines how layer groups can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how layer groups +can be switched on and off. Options: "radio" for radio buttons +(meaning only one group can be shown), "check" for check boxes +(so multiple groups can be shown), and "none" for no control +(the group cannot be (de)selected).

popup.vars
-

names of data variables that are shown in the popups in "view" mode. Set popup.vars to TRUE to show all variables in the shape object. Set popup.vars to FALSE to disable popups. Set popup.vars to a character vector of variable names to those those variables in the popups. The default (NA) depends on whether visual variables (e.g.col) are used. If so, only those are shown. If not all variables in the shape object are shown.

+

names of data variables that are shown in the popups +in "view" mode. Set popup.vars to TRUE to show all variables in the +shape object. Set popup.vars to FALSE to disable popups. Set popup.vars +to a character vector of variable names to those those variables in the popups. +The default (NA) depends on whether visual variables (e.g.fill) are used. +If so, only those are shown. If not all variables in the shape object are shown.

popup.format
-

list of formatting options for the popup values. See the argument 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 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.

+

list of formatting options for the popup values. +See the argument 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 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.

hover
@@ -166,7 +193,8 @@

Arguments mode.

+

name of the data variable that specifies the indices of the spatial +features. Only used for "view" mode.

...
@@ -175,10 +203,26 @@

Arguments

Details

-

The visual variable arguments (e.g. col) can be specified with either a data variable name (e.g., a spatial vector attribute or a raster layer of the object specified in tm_shape()), or with a visual value (for col, a color is expected). Multiple values can be specified: in that case facets are created. These facets can be combined with other faceting data variables, specified with tm_facets().

-

The .scale arguments determine the used scale to map the data values to visual variable values. These can be specified with one of the available tm_scale_ functions. The default is specified by the tmap option (tm_options()) scales.var.

-

The .legend arguments determine the used legend, specified with tm_legend(). The default legend and its settings are determined by the tmap options (tm_options()) legend. .

-

The .free arguments determine whether scales are applied freely across facets, or shared. A logical value is required. They can also be specified with a vector of three logical values; these determine whether scales are applied freely per facet dimension. This is only useful when facets are applied (see tm_facets()). There are maximally three facet dimensions: rows, columns, and pages. This only applies for a facet grid (tm_facets_grid()). For instance, col.free = c(TRUE, FALSE, FALSE) means that for the visual variable col, each row of facets will have its own scale, and therefore its own legend. For facet wraps and stacks (tm_facets_wrap() and tm_facets_stack()) there is only one facet dimension, so the .free argument requires only one logical value.

+

The visual variable arguments (e.g. col) can be specified with either a data +variable name (e.g., a spatial vector attribute or a raster layer of the object +specified in tm_shape()), or with a visual value (for col, a color is expected). +Multiple values can be specified: in that case facets are created. +These facets can be combined with other faceting data variables, specified with tm_facets().

+

The *.scale arguments determine the used scale to map the data values to +visual variable values. These can be specified with one of the available +tm_scale_*() functions. The default is specified by the tmap option (tm_options()) scales.var.

+

The *.legend arguments determine the used legend, specified with tm_legend(). +The default legend and its settings are determined by the tmap options (tm_options()) legend. .

+

The *.free arguments determine whether scales are applied freely across facets, or shared. +A logical value is required. They can also be specified with a vector of three +logical values; these determine whether scales are applied freely per facet dimension. +This is only useful when facets are applied (see tm_facets()). +There are maximally three facet dimensions: rows, columns, and pages. This only +applies for a facet grid (tm_facets_grid()). For instance, col.free = c(TRUE, FALSE, FALSE) +means that for the visual variable col, each row of facets will have its own +scale, and therefore its own legend. For facet wraps and stacks +(tm_facets_wrap() and tm_facets_stack()) there is only one facet dimension, +so the *.free argument requires only one logical value.

diff --git a/dev/reference/tm_pos.html b/dev/reference/tm_pos.html index 7a5eb69b..d51f1bf7 100644 --- a/dev/reference/tm_pos.html +++ b/dev/reference/tm_pos.html @@ -1,5 +1,17 @@ -Set the position of map components — tm_pos • tmapSet the position of map components — tm_pos • tmap @@ -53,7 +65,13 @@
-

Set the position of map components, such as legends, title, compass, scale bar, etc. tm_pos() is the function to position these components: tm_pos_out() places the components outside the map area and tm_pos_in() inside the map area. Each position argument of a map layer or component should be specified with one of these functions. The functions tm_pos_auto_out() and tm_pos_auto_in() are used to set the components automatically, and are recommended to use globally, via tmap_options(). See Details how the positioning works.

+

Set the position of map components, such as legends, title, compass, scale bar, etc. +tm_pos() is the function to position these components: +tm_pos_out() places the components outside the map area and tm_pos_in() inside the map area. +Each position argument of a map layer or component should be specified with +one of these functions. The functions tm_pos_auto_out() and tm_pos_auto_in() +are used to set the components automatically, and are recommended to use globally, +via tmap_options(). See Details how the positioning works.

@@ -72,32 +90,81 @@

Usage

Arguments

cell.h, cell.v
-

The plotting area is overlaid with a 3x3 grid, of which the middle grid cell is the map area. Components can be drawn into any cell. cell.h specifies the horizontal position (column) can take values "left", "center", and "right", and cell.v specifies the vertical position (row) and can take values "top", "center", and "bottom". See details for a graphical explanation.

+

The plotting area is overlaid with a 3x3 grid, of which +the middle grid cell is the map area. Components can be drawn into any cell. +cell.h specifies the horizontal position (column) can take values +"left", "center", and "right". cell.v specifies the vertical position +(row) and can take values "top", "center", and "bottom". +See details for a graphical explanation.

pos.h, pos.v
-

The position of the component within the cell. The main options for pos.h are "left", "center", and "right", and for cell.v these are "top", "center", and "bottom". These options can also be provided in upper case; in that case there is no offset (see the tmap option component.offset). Also numbers between 0 and 1 can be provided, which determine the position of the component inside the cell (with (0,0) being left bottom). The arguments just.h and just.v determine the justification point.

+

The position of the component within the cell. +The main options for pos.h are "left", "center", and "right". +For cell.v these are "top", "center", and "bottom". +These options can also be provided in upper case; in that case there is no offset +(see the tmap option component.offset). Also numbers between 0 and 1 can be provided, +which determine the position of the component inside the cell (with (0,0) being left bottom). +The arguments just.h and just.v determine the justification point.

align.h, align.v
-

The alignment of the component in case multiple components are stacked. When they are stacked horizontally, align.v determines how components that are smaller in height than the available height (determined by the outer.margins if specified and otherwise by the highest component) are justified: "top", "center", or "bottom". Similarly, align.h determines how components are justified horizontally when they are stacked vertically: "left", "center", or "right".

+

The alignment of the component in case multiple components are stacked. +When they are stacked horizontally, align.v determines how components +that are smaller in height than the available height (determined by the outer.margins +if specified and otherwise by the highest component) are justified: +"top", "center", or "bottom". Similarly, align.h determines how components +are justified horizontally when they are stacked vertically: "left", "center", or "right".

just.h, just.v
-

The justification of the components. Only used in case pos.h and pos.v are numbers.

+

The justification of the components. +Only used in case pos.h and pos.v are numbers.

Details

-
+-------------------+--------------------------------+-------------------+
||||
"top"||||
||||
+-------------------+--------------------------------+-------------------+
||||
||||
cell.v  "center"||   Map(s)||
||||
||||
+-------------------+--------------------------------+-------------------+
||||
"bottom"||||
||||
+-------------------+--------------------------------+-------------------+
"left""center""right"
cell.h

tm_pos_in() sets the position of the component(s) inside the maps area, which is equivalent to the center-center cell (in case there are facets, these are all drawn in this center-center cell).

+
+-------------------+--------------------------------+-------------------+
||||
"top"||||
||||
+-------------------+--------------------------------+-------------------+
||||
||||
cell.v  "center"||   Map(s)||
||||
||||
+-------------------+--------------------------------+-------------------+
||||
"bottom"||||
||||
+-------------------+--------------------------------+-------------------+
"left""center""right"
cell.h

tm_pos_in() sets the position of the component(s) inside the maps area, +which is equivalent to the center-center cell (in case there are facets, +these are all drawn in this center-center cell).

tm_pos_out() sets the position of the component(s) outside the map.

-

The amount of space that the top and bottom rows, and left and right columns occupy is determined by the tm_layout() arguments meta.margins and meta.auto.margins. The former sets the relative space of the bottom, left, top, and right side. In case these are set to NA, the space is set automatically based on 1) the maximum relative space specified by meta.auto.margins and 2) the presence and size of components in each cell. For instance, if there is one landscape oriented legend in the center-bottom cell, then the relative space of the bottom row is set to the height of that legend (given that it is smaller than the corresponding value of meta.auto.margins), while the other four sides are set to 0.

-

tm_pos_auto_out() is more complex: the cell.h and cell.v arguments of should be set to one of the four corners. It does not mean that the components are drawn in a corner. The corner represents the sides of the map that the components are drawn. By default, legends are drawn either at the bottom or on the right-side of the map by default (see tmap_options("legend.position")). Only when there are row- and column-wise legends and a general legend (using tm_facets_grid()), the general legend is drawn in the corner, but in practice this case will be rare.

-

The arguments pos.h and pos.v determine where the components are drawn within the cell. Again, with "left", "center", and "right" for pos.h and "top", "center", and "bottom" for pos.v. The values can also be specified in upper-case, which influences the offset with the cell borders, which is determined by tmap option component.offset. By default, there is a small offset when components are drawn inside and no offset when they are drawn outside or with upper-case.

-

tm_pos_auto_in() automatically determines pos.h and pos.v given the available space inside the map. This is similar to the default positioning in tmap3.

-

In case multiple components are draw in the same cell and the same position inside that cell, they are stacked (determined which the stack argument in the legend or component function). The align.h and align.v arguments determine how these components will be justified with each other.

-

Note that legends and components may be different for a facet row or column. This is the case when tm_facets_grid() or tm_facets_stack() are applied and when scales are set to free (with the .free argument of the map layer functions). In case a legends or components are draw row- or column wise, and the position of the legends (or components) is right next to the maps, these legends (or components) will be aligned with the maps.

+

The amount of space that the top and bottom rows, and left and right columns +occupy is determined by the tm_layout() arguments meta.margins and meta.auto.margins. +The former sets the relative space of the bottom, left, top, and right side. +In case these are set to NA, the space is set automatically based on 1) +the maximum relative space specified by meta.auto.margins and 2) +the presence and size of components in each cell. +For instance, if there is one landscape oriented legend in the center-bottom cell, +then the relative space of the bottom row is set to the height of that legend +(given that it is smaller than the corresponding value of meta.auto.margins), +while the other four sides are set to 0.

+

tm_pos_auto_out() is more complex: the cell.h and cell.v arguments should be set +to one of the four corners. It does not mean that the components are drawn in a corner. +The corner represents the sides of the map that the components are drawn. +By default, legends are drawn either at the bottom or on the right-side of +the map by default (see tmap_options("legend.position")). +Only when there are row- and column-wise legends and a general legend (using tm_facets_grid()), +the general legend is drawn in the corner, but in practice this case will be rare.

+

The arguments pos.h and pos.v determine where the components are drawn within the cell. +Again, with "left", "center", and "right" for pos.h +and "top", "center", and "bottom" for pos.v. +The values can also be specified in upper-case, which influences the offset +with the cell borders, which is determined by tmap option component.offset. +By default, there is a small offset when components are drawn inside and no +offset when they are drawn outside or with upper-case.

+

tm_pos_auto_in() automatically determines pos.h and pos.v given the +available space inside the map. This is similar to the default positioning in tmap3.

+

In case multiple components are draw in the same cell and the same position +inside that cell, they are stacked (determined which the stack argument in +the legend or component function). The align.h and align.v arguments +determine how these components will be justified with each other.

+

Note that legends and components may be different for a facet row or column. +This is the case when tm_facets_grid() or tm_facets_stack() are applied +and when scales are set to free (with the .free argument of the map layer functions). +In case a legends or components are draw row- or column wise, and the position +of the legends (or components) is right next to the maps, these legends +(or components) will be aligned with the maps.

Examples

diff --git a/dev/reference/tm_rgb.html b/dev/reference/tm_rgb.html index fef716a6..5d5f3027 100644 --- a/dev/reference/tm_rgb.html +++ b/dev/reference/tm_rgb.html @@ -69,7 +69,8 @@

Usage

Arguments

col, col.scale, col.legend, col.free
-

Visual variable that determines the col color.

+

Visual variable that determines +the col color.

diff --git a/dev/reference/tm_scale.html b/dev/reference/tm_scale.html index 012881bf..642681d8 100644 --- a/dev/reference/tm_scale.html +++ b/dev/reference/tm_scale.html @@ -1,5 +1,15 @@ -Scales: automatic scale — tm_scale • tmapScales: automatic scale — tm_scale • tmap @@ -53,7 +63,12 @@

-

Scales in tmap are configured by the family of functions with prefix tm_scale. Such function should be used for the input of the .scale arguments in the layer functions (e.g. fill.scale in tm_polygons()). The function tm_scale() is a scale that is set automatically given by the data type (factor, numeric, and integer) and the visual variable. The tmap option scales.var contains information which scale is applied when.

+

Scales in tmap are configured by the family of functions with prefix tm_scale. +Such function should be used for the input of the .scale arguments in the +layer functions (e.g. fill.scale in tm_polygons()). The function tm_scale() +is a scale that is set automatically given by the data type (factor, numeric, and integer) +and the visual variable. The tmap option scales.var contains information +which scale is applied when.

diff --git a/dev/reference/tm_scale_bivariate.html b/dev/reference/tm_scale_bivariate.html index ffd534d8..2bd9deb8 100644 --- a/dev/reference/tm_scale_bivariate.html +++ b/dev/reference/tm_scale_bivariate.html @@ -1,5 +1,11 @@ -Scales: bivariate scale — tm_scale_bivariate • tmapScales: bivariate scale — tm_scale_bivariate • tmap @@ -53,7 +59,10 @@
-

Scales in tmap are configured by the family of functions with prefix tm_scale. Such function should be used for the input of the .scale arguments in the layer functions (e.g. fill.scale in tm_polygons()). The function tm_scale_bivariate() is used or bivariate.scales.

+

Scales in tmap are configured by the family of functions with prefix tm_scale. +Such function should be used for the input of the .scale arguments in the +layer functions (e.g. fill.scale in tm_polygons()). +The function tm_scale_bivariate() is used for bivariate.scales.

@@ -77,7 +86,7 @@

Usage

Arguments

scale1, scale2
-

two tm_scale objects. Currently, all tm_scale_ functions are supported except tm_scale_continous().

+

two tm_scale objects. Currently, all tm_scale_*() functions are supported except tm_scale_continous().

values
diff --git a/dev/reference/tm_scale_categorical.html b/dev/reference/tm_scale_categorical.html index d88056c3..12e00ebe 100644 --- a/dev/reference/tm_scale_categorical.html +++ b/dev/reference/tm_scale_categorical.html @@ -1,5 +1,19 @@ -Scales: categorical and ordinal scale — tm_scale_ordinal • tmapScales: categorical and ordinal scale — tm_scale_ordinal • tmap @@ -53,7 +67,14 @@
-

Scales in tmap are configured by the family of functions with prefix tm_scale. Such function should be used for the input of the .scale arguments in the layer functions (e.g. fill.scale in tm_polygons()). The functions tm_scale_categorical() and tm_scale_ordinal() are used for categorical data. The only difference between these functions is that the former assumes unordered categories whereas the latter assumes ordered categories. For colors (the visual variable fill or col), different default color palettes are used (see the tmap option values.var).

+

Scales in tmap are configured by the family of functions with prefix tm_scale. +Such function should be used for the input of the .scale arguments in the +layer functions (e.g. fill.scale in tm_polygons()). +The functions tm_scale_categorical() and tm_scale_ordinal() are used +for categorical data. The only difference between these functions is that the +former assumes unordered categories whereas the latter assumes ordered categories. +For colors (the visual variable fill or col), different default color +palettes are used (see the tmap option values.var).

diff --git a/dev/reference/tm_scale_continuous.html b/dev/reference/tm_scale_continuous.html index 567fbeea..2923fe45 100644 --- a/dev/reference/tm_scale_continuous.html +++ b/dev/reference/tm_scale_continuous.html @@ -1,5 +1,13 @@ -Scales: continuous scale — tm_scale_continuous • tmapScales: continuous scale — tm_scale_continuous • tmap @@ -53,7 +61,11 @@
-

Scales in tmap are configured by the family of functions with prefix tm_scale. Such function should be used for the input of the .scale arguments in the layer functions (e.g. fill.scale in tm_polygons()). The function tm_scale_continuous is used for continuous data. The functions tm_scale_continuous_<x> use transformation functions x.

+

Scales in tmap are configured by the family of functions with prefix tm_scale. +Such function should be used for the input of the .scale arguments in the layer +functions (e.g. fill.scale in tm_polygons()). +The function tm_scale_continuous() is used for continuous data. +The functions tm_scale_continuous_<x>() use transformation functions x.

diff --git a/dev/reference/tm_scale_discrete.html b/dev/reference/tm_scale_discrete.html index 5ad7e9c7..b2f6b64f 100644 --- a/dev/reference/tm_scale_discrete.html +++ b/dev/reference/tm_scale_discrete.html @@ -1,5 +1,11 @@ -Scales: discrete scale — tm_scale_discrete • tmapScales: discrete scale — tm_scale_discrete • tmap @@ -53,7 +59,10 @@
-

Scales in tmap are configured by the family of functions with prefix tm_scale. Such function should be used for the input of the .scale arguments in the layer functions (e.g. fill.scale in tm_polygons()). The function tm_scale_discrete() is used for discrete numerical data, such as integers.

+

Scales in tmap are configured by the family of functions with prefix tm_scale. +Such function should be used for the input of the .scale arguments in the +layer functions (e.g. fill.scale in tm_polygons()). +The function tm_scale_discrete() is used for discrete numerical data, such as integers.

diff --git a/dev/reference/tm_scale_intervals.html b/dev/reference/tm_scale_intervals.html index ce7ea6c5..71a1dd1a 100644 --- a/dev/reference/tm_scale_intervals.html +++ b/dev/reference/tm_scale_intervals.html @@ -1,5 +1,11 @@ -Scales: interval scale — tm_scale_intervals • tmapScales: interval scale — tm_scale_intervals • tmap @@ -53,7 +59,10 @@
-

Scales in tmap are configured by the family of functions with prefix tm_scale. Such function should be used for the input of the .scale arguments in the layer functions (e.g. fill.scale in tm_polygons()). The function tm_scale_interval is used for numerical data.

+

Scales in tmap are configured by the family of functions with prefix tm_scale. +Such function should be used for the input of the .scale arguments in the +layer functions (e.g. fill.scale in tm_polygons()). +The function tm_scale_interval() is used for numerical data.

diff --git a/dev/reference/tm_scalebar.html b/dev/reference/tm_scalebar.html index 065b1bfa..44fcb047 100644 --- a/dev/reference/tm_scalebar.html +++ b/dev/reference/tm_scalebar.html @@ -1,5 +1,9 @@ -Map component: scale bar — tm_scalebar • tmapMap component: scale bar — tm_scalebar • tmap @@ -53,7 +57,9 @@
-

Map component that adds a scale bar. As of version 4.0, tm_scalebar() is used instead of tm_scale_bar (now deprecated), because of the potential confusion with the tm_scale_x scaling functions (like tm_scale_continuous()).

+

Map component that adds a scale bar. As of version 4.0, tm_scalebar() is +used instead of tm_scale_bar() (now deprecated), because of the potential +confusion with the tm_scale_*() scaling functions (like tm_scale_continuous()).

diff --git a/dev/reference/tm_sf.html b/dev/reference/tm_sf.html index 73ffb9df..4ceea619 100644 --- a/dev/reference/tm_sf.html +++ b/dev/reference/tm_sf.html @@ -1,5 +1,11 @@ -Map layer: simple features — tm_sf • tmapMap layer: simple features — tm_sf • tmap @@ -53,7 +59,10 @@
-

Map layer that draws simple features as they are. Supported visual variables are: fill (the fill color), col (the border color), size the point size, shape the symbol shape, lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) and col_alpha (border color alpha transparency).

+

Map layer that draws simple features as they are. Supported visual variables +are: fill (the fill color), col (the border color), size the point size, +shape the symbol shape, lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) +and col_alpha (border color alpha transparency).

@@ -110,35 +119,43 @@

Usage

Arguments

fill, fill.scale, fill.legend, fill.free
-

Visual variable that determines the fill color. See details.

+

Visual variable that determines +the fill color. See details.

col, col.scale, col.legend, col.free
-

Visual variable that determines the col color. See details.

+

Visual variable that determines +the col color. See details.

size, size.scale, size.legend, size.free
-

Visual variable that determines the size. See details.

+

Visual variable that determines +the size. See details.

shape, shape.scale, shape.legend, shape.free
-

Visual variable that determines the shape. See details.

+

Visual variable that determines +the shape. See details.

lwd, lwd.scale, lwd.legend, lwd.free
-

Visual variable that determines the line width. See details.

+

Visual variable that determines +the line width. See details.

lty, lty.scale, lty.legend, lty.free
-

Visual variable that determines the line type. See details.

+

Visual variable that determines +the line type. See details.

fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.free
-

Visual variable that determines the fill color alpha transparency See details.

+

Visual +variable that determines the fill color alpha transparency See details.

col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free
-

Visual variable that determines the border color alpha transparency. See details.

+

Visual variable +that determines the border color alpha transparency. See details.

linejoin, lineend
@@ -146,23 +163,33 @@

Argumentstm_plot_order() is required.

+

Specification in which order the spatial features are drawn. +This consists of a list of three elementary geometry types: for polygons, lines and, points. +For each of these types, which are drawn in that order, a tm_plot_order() is required.

trans.args.list, mapping.args.list
-

lists that are passed on to internal transformation and mapping functions respectively. Each is a list of three items, named polygons, lines, and points. See tm_polygons(), tm_lines(), and tm_dots().

+

lists that are passed on to internal +transformation and mapping functions respectively. Each is a list of three +items, named polygons, lines, and points. See tm_polygons(), tm_lines(), and tm_dots().

zindex
-

Map layers are drawn on top of each other. The zindex numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.

+

Map layers are drawn on top of each other. +The zindex numbers (one for each map layer) determines the stacking order. +By default the map layers are drawn in the order they are called.

group
-

Name of the group to which this layer belongs. This is only relevant in view mode, where layer groups can be switched (see group.control)

+

Name of the group to which this layer belongs. +This is only relevant in view mode, where layer groups can be switched (see group.control).

group.control
-

In view mode, the group control determines how layer groups can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how layer +groups can be switched on and off. Options: "radio" for radio buttons +(meaning only one group can be shown), "check" for check boxes +(so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

...
@@ -171,10 +198,26 @@

Arguments

Details

-

The visual variable arguments (e.g. col) can be specified with either a data variable name (of the object specified in tm_shape()), or with a visual value (for col, a color is expected). Multiple values can be specified: in that case facets are created. These facets can be combined with other faceting data variables, specified with tm_facets().

-

The .scale arguments determine the used scale to map the data values to visual variable values. These can be specified with one of the available tm_scale_ functions. The default scale that is used is specified by the tmap option scales.var.

-

The .legend arguments determine the used legend, specified with tm_legend(). The default legend and its settings are determined by the tmap options legend..

-

The .free arguments determine whether scales are applied freely across facets, or shared. A logical value is required. They can also be specified with a vector of three logical values; these determine whether scales are applied freely per facet dimension. This is only useful when facets are applied (see tm_facets()). There are maximally three facet dimensions: rows, columns, and pages. This only applies for a facet grid (tm_facets_grid()). For instance, col.free = c(TRUE, FALSE, FALSE) means that for the visual variable col, each row of facets will have its own scale, and therefore its own legend. For facet wraps and stacks (tm_facets_wrap() and tm_facets_stack()) there is only one facet dimension, so the .free argument requires only one logical value.

+

The visual variable arguments (e.g. col) can be specified with either a data +variable name (of the object specified in tm_shape()), or with a visual value +(for col, a color is expected). Multiple values can be specified: in that case +facets are created. These facets can be combined with other faceting data variables, +specified with tm_facets().

+

The .scale arguments determine the used scale to map the data values to visual +variable values. These can be specified with one of the available tm_scale_() functions. +The default scale that is used is specified by the tmap option scales.var.

+

The .legend arguments determine the used legend, specified with tm_legend(). +The default legend and its settings are determined by the tmap options legend..

+

The .free arguments determine whether scales are applied freely across facets, +or shared. A logical value is required. They can also be specified with a +vector of three logical values; these determine whether scales are applied freely +per facet dimension. This is only useful when facets are applied (see tm_facets()). +There are maximally three facet dimensions: rows, columns, and pages. This only applies +for a facet grid (tm_facets_grid()). For instance, col.free = c(TRUE, FALSE, FALSE) means +that for the visual variable col, each row of facets will have its own scale, +and therefore its own legend. For facet wraps and stacks (tm_facets_wrap() and +tm_facets_stack()) there is only one facet dimension, so the .free argument requires +only one logical value.

diff --git a/dev/reference/tm_shape.html b/dev/reference/tm_shape.html index f7c37d99..6a99c329 100644 --- a/dev/reference/tm_shape.html +++ b/dev/reference/tm_shape.html @@ -1,5 +1,7 @@ -Shape (spatial object) specification — tm_shape • tmapShape (spatial object) specification — tm_shape • tmap @@ -53,7 +55,8 @@
-

Specify a shape, which is a spatial object from one of these spatial object class packages: sf, stars, terra.

+

Specify a shape, which is a spatial object from one of these spatial object +class packages: sf, stars, or terra.

-

Map layer that draws symbols Supported visual variables are: fill (the fill color), col (the border color), size the symbol size, shape the symbol shape, lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) and col_alpha (border color alpha transparency).

+

Map layer that draws symbols Supported visual variables are: +fill (the fill color), col (the border color), size the symbol size, +shape the symbol shape, lwd (line width), lty (line type), fill_alpha +(fill color alpha transparency) and col_alpha (border color alpha transparency).

@@ -203,39 +212,59 @@

Argumentstm_plot_order() for details.

+

Specification in which order the spatial features are drawn. +See tm_plot_order() for details.

trans.args, mapping.args
-

lists that are passed on to internal transformation and mapping functions respectively

+

lists that are passed on to internal +transformation and mapping functions respectively

zindex
-

Map layers are drawn on top of each other. The zindex numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.

+

Map layers are drawn on top of each other. The zindex numbers +(one for each map layer) determines the stacking order. By default the map +layers are drawn in the order they are called.

group
-

Name of the group to which this layer belongs. This is only relevant in view mode, where layer groups can be switched (see group.control)

+

Name of the group to which this layer belongs. +This is only relevant in view mode, where layer groups can be switched +(see group.control)

group.control
-

In view mode, the group control determines how layer groups can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how layer +groups can be switched on and off. Options: "radio" for radio buttons +(meaning only one group can be shown), "check" for check boxes +(so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

popup.vars
-

names of data variables that are shown in the popups in "view" mode. Set popup.vars to TRUE to show all variables in the shape object. Set popup.vars to FALSE to disable popups. Set popup.vars to a character vector of variable names to those those variables in the popups. The default (NA) depends on whether visual variables (e.g.col) are used. If so, only those are shown. If not all variables in the shape object are shown.

+

names of data variables that are shown in the popups in +"view" mode. Set popup.vars to TRUE to show all variables in the shape object. +Set popup.vars to FALSE to disable popups. Set popup.vars to a character vector +of variable names to those those variables in the popups. The default (NA) +depends on whether visual variables (e.g.col) are used. If so, only those are shown. +If not all variables in the shape object are shown.

popup.format
-

list of formatting options for the popup values. See the argument 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 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.

+

list of formatting options for the popup values. +See the argument 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 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.

hover
@@ -243,7 +272,8 @@

Arguments mode.

+

name of the data variable that specifies the indices of the spatial features. +Only used for "view" mode.

...
@@ -252,10 +282,26 @@

Arguments

Details

-

The visual variable arguments (e.g. col) can be specified with either a data variable name (of the object specified in tm_shape()), or with a visual value (for col, a color is expected). Multiple values can be specified: in that case facets are created. These facets can be combined with other faceting data variables, specified with tm_facets().

-

The .scale arguments determine the used scale to map the data values to visual variable values. These can be specified with one of the available tm_scale_ functions. The default scale that is used is specified by the tmap option scales.var.

-

The .legend arguments determine the used legend, specified with tm_legend(). The default legend and its settings are determined by the tmap options legend..

-

The .free arguments determine whether scales are applied freely across facets, or shared. A logical value is required. They can also be specified with a vector of three logical values; these determine whether scales are applied freely per facet dimension. This is only useful when facets are applied (see tm_facets()). There are maximally three facet dimensions: rows, columns, and pages. This only applies for a facet grid (tm_facets_grid()). For instance, col.free = c(TRUE, FALSE, FALSE) means that for the visual variable col, each row of facets will have its own scale, and therefore its own legend. For facet wraps and stacks (tm_facets_wrap() and tm_facets_stack()) there is only one facet dimension, so the .free argument requires only one logical value.

+

The visual variable arguments (e.g. col) can be specified with either a data +variable name (of the object specified in tm_shape()), or with a visual value +(for col, a color is expected). Multiple values can be specified: in that case +facets are created. These facets can be combined with other faceting data variables, +specified with tm_facets().

+

The .scale arguments determine the used scale to map the data values to visual +variable values. These can be specified with one of the available tm_scale_ functions. +The default scale that is used is specified by the tmap option scales.var.

+

The .legend arguments determine the used legend, specified with tm_legend(). +The default legend and its settings are determined by the tmap options legend..

+

The .free arguments determine whether scales are applied freely across facets, +or shared. A logical value is required. They can also be specified with a vector +of three logical values; these determine whether scales are applied freely per +facet dimension. This is only useful when facets are applied (see tm_facets()). +There are maximally three facet dimensions: rows, columns, and pages. +This only applies for a facet grid (tm_facets_grid()). +For instance, col.free = c(TRUE, FALSE, FALSE) means that for the visual variable +col, each row of facets will have its own scale, and therefore its own legend. +For facet wraps and stacks (tm_facets_wrap() and tm_facets_stack()), +there is only one facet dimension, so the .free argument requires only one logical value.

diff --git a/dev/reference/tm_text.html b/dev/reference/tm_text.html index bcdbc409..07aa9717 100644 --- a/dev/reference/tm_text.html +++ b/dev/reference/tm_text.html @@ -1,5 +1,7 @@ -Map layer: text — tm_text • tmapMap layer: text — tm_text • tmap @@ -53,7 +55,8 @@
-

Map layer that draws symbols Supported visual variables are: text (the text itself) col (color), size (font size), and fontface (font face).

+

Map layer that draws symbols Supported visual variables are: text +(the text itself) col (color), size (font size), and fontface (font face).

@@ -94,23 +97,28 @@

Usage

Arguments

text, text.scale, text.legend, text.free
-

Visual variable that determines the text. See details.

+

Visual variable that determines +the text. See details.

size, size.scale, size.legend, size.free
-

Visual variable that determines the font size. See details.

+

Visual variable that determines +the font size. See details.

col, col.scale, col.legend, col.free
-

Visual variable that determines the col color. See details.

+

Visual variable that determines +the col color. See details.

col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free
-

Visual variable that determines the border color alpha transparency. See Details.

+

Visual variable that determines +the border color alpha transparency. See Details.

fontface, fontface.scale, fontface.legend, fontface.free
-

Visual variable that determines the font face. See Details.

+

Visual variable that determines +the font face. See Details.

fontfamily
@@ -122,23 +130,31 @@

Argumentstm_plot_order() for details.

+

Specification in which order the spatial features are drawn. +See tm_plot_order() for details.

trans.args, mapping.args
-

lists that are passed on to internal transformation and mapping functions respectively

+

lists that are passed on to internal transformation +and mapping functions respectively.

zindex
-

Map layers are drawn on top of each other. The zindex numbers (one for each map layer) determines the stacking order. By default the map layers are drawn in the order they are called.

+

Map layers are drawn on top of each other. The zindex numbers +(one for each map layer) determines the stacking order. +By default the map layers are drawn in the order they are called.

group
-

Name of the group to which this layer belongs. This is only relevant in view mode, where layer groups can be switched (see group.control)

+

Name of the group to which this layer belongs. This is only +relevant in view mode, where layer groups can be switched (see group.control)

group.control
-

In view mode, the group control determines how layer groups can be switched on and off. Options: "radio" for radio buttons (meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), and "none" for no control (the group cannot be (de)selected).

+

In view mode, the group control determines how layer +groups can be switched on and off. Options: "radio" for radio buttons +(meaning only one group can be shown), "check" for check boxes (so multiple groups can be shown), +and "none" for no control (the group cannot be (de)selected).

...
@@ -147,10 +163,27 @@

Arguments

Details

-

The visual variable arguments (e.g. col) can be specified with either a data variable name (of the object specified in tm_shape()), or with a visual value (for col, a color is expected). Multiple values can be specified: in that case facets are created. These facets can be combined with other faceting data variables, specified with tm_facets().

-

The .scale arguments determine the used scale to map the data values to visual variable values. These can be specified with one of the available tm_scale_ functions. The default scale that is used is specified by the tmap option scales.var.

-

The .legend arguments determine the used legend, specified with tm_legend(). The default legend and its settings are determined by the tmap options legend..

-

The .free arguments determine whether scales are applied freely across facets, or shared. A logical value is required. They can also be specified with a vector of three logical values; these determine whether scales are applied freely per facet dimension. This is only useful when facets are applied (see tm_facets()). There are maximally three facet dimensions: rows, columns, and pages. This only applies for a facet grid (tm_facets_grid()). For instance, col.free = c(TRUE, FALSE, FALSE) means that for the visual variable col, each row of facets will has its own scale, and therefore its own legend. For facet wraps and stacks (tm_facets_wrap() and tm_facets_stack()) there is only one facet dimension, so the .free argument requires only one logical value.

+

The visual variable arguments (e.g. col) can be specified with either a +data variable name (of the object specified in tm_shape()), or with a visual +value (for col, a color is expected). Multiple values can be specified: +in that case facets are created. These facets can be combined with other +faceting data variables, specified with tm_facets().

+

The .scale arguments determine the used scale to map the data values to +visual variable values. These can be specified with one of the available +tm_scale_() functions. The default scale that is used is specified by the +tmap option scales.var.

+

The .legend arguments determine the used legend, specified with tm_legend(). +The default legend and its settings are determined by the tmap options legend..

+

The .free arguments determine whether scales are applied freely across facets, +or shared. A logical value is required. They can also be specified with a +vector of three logical values; these determine whether scales are applied +freely per facet dimension. This is only useful when facets are applied +(see tm_facets()). There are maximally three facet dimensions: rows, columns, +and pages. This only applies for a facet grid (tm_facets_grid()). +For instance, col.free = c(TRUE, FALSE, FALSE) means that for the visual +variable col, each row of facets will has its own scale, and therefore its +own legend. For facet wraps and stacks (tm_facets_wrap() and tm_facets_stack()) +there is only one facet dimension, so the .free argument requires only one logical value.

diff --git a/dev/reference/tm_view.html b/dev/reference/tm_view.html index b293cf0e..95cedd64 100644 --- a/dev/reference/tm_view.html +++ b/dev/reference/tm_view.html @@ -89,19 +89,26 @@

ArgumentsleafletOptions()

+

options passed on to +leafletOptions()

diff --git a/dev/reference/tmap-package.html b/dev/reference/tmap-package.html index f2baf2e0..0960162f 100644 --- a/dev/reference/tmap-package.html +++ b/dev/reference/tmap-package.html @@ -1,5 +1,11 @@ -Thematic Map Visualization — tmap-package • tmapThematic Map Visualization — tmap-package • tmap @@ -53,13 +59,17 @@

-

Thematic maps are geographical maps in which spatial data distributions are visualized. This package offers a flexible, layer-based, and easy to use approach to create thematic maps, such as choropleths and bubble maps. It is based on the grammar of graphics, and resembles the syntax of ggplot2.

+

Thematic maps are geographical maps in which spatial data distributions are visualized. +This package offers a flexible, layer-based, and easy to use approach to create +thematic maps, such as choropleths and bubble maps. It is based on the grammar +of graphics, and resembles the syntax of ggplot2.

Details

-

This page provides a brief overview of all package functions. See vignette("tmap_sneak_peek") for a short introduction with examples.

+

This page provides a brief overview of all package functions. +See vignette("tmap_sneak_peek") for a short introduction with examples.

-

Internal method that split shape objects. So far, only used to split stars object (from dimension to attributes)

+

Internal method that split shape objects. So far, only used to split stars object +(from dimension to attributes)

diff --git a/dev/reference/tmap_animation.html b/dev/reference/tmap_animation.html index db8b510e..9bcf2961 100644 --- a/dev/reference/tmap_animation.html +++ b/dev/reference/tmap_animation.html @@ -78,19 +78,30 @@

Usage

Arguments

tm
-

tmap or a list of tmap objects. If tm is a tmap object, facets should be created, where nrow and ncol in tm_facets() have to be set to 1 in order to create one map per frame.

+

tmap or a list of tmap objects. If tm is a tmap object, +facets should be created, where nrow and ncol in tm_facets() have to +be set to 1 in order to create one map per frame.

filename
-

filename. If omitted (default), the animation will be shown in the viewer or browser. If specified, it should be a gif file or a video file (i.e. mp4). The package gifski is required to create a gif animation. The package av (which uses the FFmpeg library) is required for video formats. The mp4 format is recommended but many other video formats are supported, such as wmv, avi, and mkv.

+

filename. If omitted (default), the animation will be shown +in the viewer or browser. If specified, it should be a gif file or a video +file (i.e. mp4). The package gifski is required to create a gif animation. +The package av (which uses the FFmpeg library) is required for video formats. +The mp4 format is recommended but many other video formats are supported, +such as wmv, avi, and mkv.

width, height
-

width and height of the animation file (in pixels). Required when tm is a list, and recommended to specify in advance when tm is a tmap object. If not specified in the latter case, it will be determined by the aspect ratio of the map.

+

Dimensions of the animation file (in pixels). +Required when tm is a list, and recommended to specify in advance when +tm is a tmap object. If not specified in the latter case, it will be +determined by the aspect ratio of the map.

dpi
-

dots per inch. By default 100, but this can be set with the option output.dpi.animation in tmap_options().

+

dots per inch. By default 100, but this can be set with the option +output.dpi.animation in tmap_options().

delay
@@ -98,27 +109,33 @@

Argumentstmap_save()) overrides the outer.margins argument of tm_layout() (unless set to NA)

+

(passed on to tmap_save()) overrides the outer.margins +argument of tm_layout() (unless set to NA)

asp
-

(passed on to tmap_save()) if specified, it overrides the asp argument of tm_layout(). Tip: set to 0 if map frame should be placed on the edges of the image.

+

(passed on to tmap_save()) if specified, it overrides the asp +argument of tm_layout(). Tip: set to 0 if map frame should be placed on +the edges of the image.

scale
-

(passed on to tmap_save()) overrides the scale argument of tm_layout() (unless set to NA)

+

(passed on to tmap_save()) overrides the scale argument of +tm_layout() (unless set to NA)

restart.delay
-

not used anymore

+

not used anymore.

...
diff --git a/dev/reference/tmap_arrange.html b/dev/reference/tmap_arrange.html index bcef9539..40ffcaba 100644 --- a/dev/reference/tmap_arrange.html +++ b/dev/reference/tmap_arrange.html @@ -1,5 +1,9 @@ -Arrange small multiples in grid layout — tmap_arrange • tmapArrange small multiples in grid layout — tmap_arrange • tmap @@ -53,7 +57,9 @@

-

Arrange small multiples in a grid layout. Normally, small multiples are created by specifying multiple variables for one aesthetic or by specifying the by argument (see tm_facets()). This function can be used to arrange custom small multiples in a grid layout.

+

Arrange small multiples in a grid layout. Normally, small multiples are created +by specifying multiple variables for one aesthetic or by specifying the by argument +(see tm_facets()). This function can be used to arrange custom small multiples in a grid layout.

@@ -78,7 +84,8 @@

Usage

Arguments

...
-

tmap objects or one list of tmap objects. The number of multiples that can be plot is limited (see details).

+

tmap objects or one list of tmap objects. +The number of multiples that can be plot is limited (see details).

ncol
@@ -90,27 +97,38 @@

Argumentstm_layout() (also a tmap option). This argument will overwrite it, unless set to NULL. The default value for asp is 0, which means that the aspect ratio is adjusted to the size of the device divided by the number of columns and rows. When asp is set to NA, which is also the default value for tm_layout(), the aspect ratio will be adjusted to the used shapes.

+

aspect ratio. The aspect ratio of each map. Normally, this is +controlled by the asp argument from tm_layout() (also a tmap option). +This argument will overwrite it, unless set to NULL. +The default value for asp is 0, which means that the aspect ratio is +adjusted to the size of the device divided by the number of columns and rows. +When asp is set to NA, which is also the default value for tm_layout(), +the aspect ratio will be adjusted to the used shapes.

outer.margins
-

outer.margins, numeric vector four or a single value. If defines the outer margins for each multiple. If will overwrite the outer.margins argument from tm_layout(), unless set to NULL.

+

outer.margins, numeric vector four or a single value. +If defines the outer margins for each multiple. If will overwrite the +outer.margins argument from tm_layout(), unless set to NULL.

x
-

a tmap_arrange object (returned from tmap_arrange())

+

a tmap_arrange object (returned from tmap_arrange()).

options
@@ -123,7 +141,9 @@

Arguments

Details

-

The global option tmap.limits controls the limit of the number of facets that are plotted. By default, tmap_options(tmap.limits = c(facets.view=4, facets.plot=64)). The maximum number of interactive facets is set to four since otherwise it may become very slow.

+

The global option tmap.limits controls the limit of the number of facets that are plotted. +By default, tmap_options(tmap.limits = c(facets.view=4, facets.plot=64)). +The maximum number of interactive facets is set to four since otherwise it may become very slow.

diff --git a/dev/reference/tmap_design_mode.html b/dev/reference/tmap_design_mode.html index 92baa814..dc17597e 100644 --- a/dev/reference/tmap_design_mode.html +++ b/dev/reference/tmap_design_mode.html @@ -1,5 +1,13 @@ -Set the design mode — tmap_design_mode • tmapSet the design mode — tmap_design_mode • tmap @@ -53,7 +61,11 @@
-

When the so-called "design mode" is enabled, inner and outer margins, legend position, and aspect ratio are shown explicitly in plot mode. Also, information about aspect ratios is printed in the console. This function sets the global option tmap.design.mode. It can be used as toggle function without arguments.

+

When the so-called "design mode" is enabled, inner and outer margins, +legend position, and aspect ratio are shown explicitly in plot mode. +Also, information about aspect ratios is printed in the console. +This function sets the global option tmap.design.mode. +It can be used as toggle function without arguments.

@@ -64,7 +76,8 @@

Usage

Arguments

design.mode
-

Logical value that determines the design mode. If omitted then the design mode is toggled.

+

Logical value that determines the design mode. +If omitted then the design mode is toggled.

diff --git a/dev/reference/tmap_devel_mode.html b/dev/reference/tmap_devel_mode.html index f135eabb..76cc190f 100644 --- a/dev/reference/tmap_devel_mode.html +++ b/dev/reference/tmap_devel_mode.html @@ -1,5 +1,7 @@ -Set the development mode — tmap_devel_mode • tmapSet the development mode — tmap_devel_mode • tmap @@ -53,7 +55,8 @@
-

When the so-called "development mode" is enabled, helpful messages and timings are printed in the console

+

When the so-called "development mode" is enabled, helpful messages and timings +are printed in the console

@@ -64,7 +67,8 @@

Usage

Arguments

devel.mode
-

logical value that determines the development mode. If omitted then the development mode is toggled.

+

logical value that determines the development mode. +If omitted then the development mode is toggled.

diff --git a/dev/reference/tmap_format.html b/dev/reference/tmap_format.html index 012109a9..200be96d 100644 --- a/dev/reference/tmap_format.html +++ b/dev/reference/tmap_format.html @@ -1,5 +1,11 @@ -Get or add format options — tmap_format • tmapGet or add format options — tmap_format • tmap @@ -53,7 +59,10 @@

-

Format options are tmap options that are shape dependent. With tmap_format() the predefined formats can be retrieved. The values for a specific format can be retrieved with tmap_format(format), where format is the name of the format. The function tmap_format_add() is used to add a format.

+

Format options are tmap options that are shape dependent. +With tmap_format() the predefined formats can be retrieved. +The values for a specific format can be retrieved with tmap_format(format), +where format is the name of the format. The function tmap_format_add() is used to add a format.

@@ -81,12 +90,16 @@

ArgumentsValue

-

The function tmap_format() returns the names of the available formats. When format is defined, it returns the option list corresponding the that format.

+

The function tmap_format() returns the names of the available formats. +When format is defined, it returns the option list corresponding the that format.

See also

-

tm_layout() for predefined styles, tmap_style_catalogue (not migrated to v4 yet) to create a style catalogue of all available styles, and tmap_options() for tmap options.

-

tmap_options() for tmap options

+
+
  • tm_layout() for predefined styles

  • +
  • tmap_style_catalogue (not migrated to v4 yet) to create a style catalogue of all available styles

  • +
  • tmap_options() for tmap options

  • +
diff --git a/dev/reference/tmap_icons.html b/dev/reference/tmap_icons.html index 537732de..886c615d 100644 --- a/dev/reference/tmap_icons.html +++ b/dev/reference/tmap_icons.html @@ -1,5 +1,7 @@ -Specify icons — tmap_icons • tmapSpecify icons — tmap_icons • tmap @@ -53,7 +55,8 @@
-

Specifies icons from a png images, which can be used as markers in thematic maps. The function marker_icon() is the specification of the default marker.

+

Specifies icons from a png images, which can be used as markers in thematic maps. +The function marker_icon() is the specification of the default marker.

diff --git a/dev/reference/tmap_last.html b/dev/reference/tmap_last.html index 9c4a816d..f783311f 100644 --- a/dev/reference/tmap_last.html +++ b/dev/reference/tmap_last.html @@ -1,5 +1,9 @@ -Retrieve the last map to be modified or created — tmap_last • tmapRetrieve the last map to be modified or created — tmap_last • tmap @@ -53,7 +57,9 @@
-

Retrieve the last map to be modified or created. Works in the same way as ggplot2::last_plot(), although there is a difference: tmap_last() returns the last call instead of the stacked tmap-elements.

+

Retrieve the last map to be modified or created. Works in the same way +as ggplot2::last_plot(), although there is a difference: +tmap_last() returns the last call instead of the stacked tmap-elements.

diff --git a/dev/reference/tmap_leaflet.html b/dev/reference/tmap_leaflet.html index fa95bc45..26ae26f8 100644 --- a/dev/reference/tmap_leaflet.html +++ b/dev/reference/tmap_leaflet.html @@ -101,7 +101,8 @@

Value

  • tmap_grid() returns a grob object ("plot" mode)

  • -
  • tmap_leaflet() a leaflet object ("view" mode). In case small multiples are shown, a list is returned.

  • +
  • tmap_leaflet() a leaflet object ("view" mode). +In case small multiples are shown, a list is returned.

  • diff --git a/dev/reference/tmap_mode.html b/dev/reference/tmap_mode.html index 7146f67c..0ad49dab 100644 --- a/dev/reference/tmap_mode.html +++ b/dev/reference/tmap_mode.html @@ -1,5 +1,21 @@ -Set tmap mode to static plotting or interactive viewing — tmap_mode • tmapSet tmap mode to static plotting or interactive viewing — tmap_mode • tmap @@ -53,7 +69,15 @@
    -

    Set tmap mode to static plotting or interactive viewing. The global option tmap.mode determines the whether thematic maps are plot in the graphics device, or shown as an interactive leaflet map (see also tmap_options(). The function tmap_mode is a wrapper to set this global option. The convenient function ttm, which stands for toggle thematic map, is a toggle switch between the two modes. The function ttmp stands for toggle thematic map and print last map: it does the same as ttm followed by tmap_last(); in order words, it shows the last map in the other mode. It is recommended to use tmap_mode() in scripts and ttm/ttmp in the console.

    +

    Set tmap mode to static plotting or interactive viewing. +The global option tmap.mode determines the whether thematic maps are plot +in the graphics device, or shown as an interactive leaflet map (see also tmap_options(). +The function tmap_mode() is a wrapper to set this global option. +The convenient function ttm(), which stands for toggle thematic map, +is a toggle switch between the two modes. The function ttmp() stands for +toggle thematic map and print last map: it does the same as ttm() followed +by tmap_last(); in order words, it shows the last map in the other mode. +It is recommended to use tmap_mode() in scripts and ttm()/ttmp() in the console.

    @@ -68,34 +92,54 @@

    Usage

    Arguments

    mode
    -

    One of:

    "plot"
    -

    Thematic maps are shown in the graphics device. This is the default mode, and supports all tmap's features, such as small multiples (see tm_facets()) and extensive layout settings (see tm_layout()). It is recommended for saving static maps (see tmap_save()).

    - -
    "view"
    -

    Thematic maps are viewed interactively in the web browser or RStudio's Viewer pane. Maps are fully interactive with tiles from OpenStreetMap or other map providers (see tm_tiles()). See also tm_view() for options related to the "view" mode. This mode generates a leaflet::leaflet() widget, which can also be directly obtained with tmap_leaflet(). With R Markdown, it is possible to publish it to an HTML page. -There are a couple of constraints in comparison to "plot":

    • The map is always projected according to the Web Mercator projection. Although this projection is the de facto standard for interactive web-based mapping, it lacks the equal-area property, which is important for many thematic maps, especially choropleths (see examples from tm_shape()).

    • -
    • Small multiples are not supported

    • -
    • The legend cannot be made for aesthetics regarding size, which are symbol size and line width.

    • -
    • Text labels are not supported (yet)

    • -
    • The layout options set with tm_layout()) regarding map format are not used. However, the styling options still apply.

    • -
    - -
    +

    One of "plot" or "view". See Details for more info.

    Value

    -

    The mode before changing

    +

    The previous tmap mode before switching.

    +
    +

    mode = "plot"

    +

    Thematic maps are shown in the graphics device. +This is the default mode, and supports all tmap's features, +such as small multiples (see tm_facets()) and extensive layout settings (see tm_layout()). +It is recommended to use tmap_save() for saving static maps.

    +
    +
    +

    mode = "view"

    +

    Thematic maps are viewed interactively in the web browser or RStudio's Viewer pane. +Maps are fully interactive with tiles from OpenStreetMap or other map providers +(see tm_tiles()). See also tm_view() for options related to the "view" mode. +This mode generates a leaflet::leaflet() widget, which can also be directly +obtained with tmap_leaflet(). +With R Markdown, it is possible to publish it to an HTML page.

    +

    However, there are a couple of constraints in comparison to "plot":

    • The map is always projected according to the Web Mercator projection. +Although this projection is the de facto standard for interactive web-based mapping, +it lacks the equal-area property, which is important for many thematic maps, +especially choropleths (see examples from tm_shape()).

    • +
    • Small multiples are not supported

    • +
    • The legend cannot be made for aesthetics regarding size, which are symbol size and line width.

    • +
    • Text labels are not supported (yet)

    • +
    • The layout options set with tm_layout()) regarding map format are not used. +However, the styling options still apply.

    • +

    References

    -

    Tennekes, M., 2018, tmap: Thematic Maps in R, Journal of Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06

    +

    Tennekes, M., 2018, tmap: Thematic Maps in R, +Journal of Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06

    See also

    -

    vignette("tmap_sneak_peek"), tmap_last() to show the last map, tm_view() for viewing options, and tmap_leaflet() for obtaining a leaflet widget, and tmap_options() for tmap options.

    +
    +
    diff --git a/dev/reference/tmap_save.html b/dev/reference/tmap_save.html index 5befbbe8..d1951aad 100644 --- a/dev/reference/tmap_save.html +++ b/dev/reference/tmap_save.html @@ -86,23 +86,42 @@

    Arguments mode and as an interactive map (html) in "view" mode (see details). The default format for static plots is png, but this can be changed using the option "output.format" in tmap_options(). If NA (the default), the file is saved as "tmap01" in the default format, and the number incremented if the file already exists.

    +

    filename including extension, and optionally the path. +The extensions pdf, eps, svg, wmf (Windows only), png, jpg, bmp, tiff, and html are supported. +If the extension is missing, the file will be saved as a static plot in "plot" +mode and as an interactive map (html) in "view" mode (see details). +The default format for static plots is png, but this can be changed using +the option "output.format" in tmap_options(). If NA (the default), +the file is saved as "tmap01" in the default format, and the number incremented +if the file already exists.

    device
    -

    graphic device to use. Either a device function (e.g., png or cairo_pdf) or a text indicating selected graphic device: "pdf", "eps", "svg", "wmf" (Windows only), "png", "jpg", "bmp", "tiff". If NULL, the graphic device is guessed based on the filename argument.

    +

    graphic device to use. Either a device function +(e.g., png or cairo_pdf) +or a text indicating selected graphic device: "pdf", "eps", "svg", "wmf" (Windows only), "png", "jpg", "bmp", "tiff". +If NULL, the graphic device is guessed based on the filename argument.

    height, width
    -

    The width and height of the plot (not applicable for html files). Units are set with the argument units. If one of them is not specified, this is calculated using the formula asp = width / height, where asp is the estimated aspect ratio of the map. If both are missing, they are set such that width * height is equal to the option "output.size" in tmap_options(). This is by default 49, meaning that is the map is a square (so aspect ratio of 1) both width and height are set to 7.

    +

    The dimensions of the plot (not applicable for html files). +Units are set with the argument units. If one of them is not specified, +this is calculated using the formula asp = width / height, where asp is the +estimated aspect ratio of the map. If both are missing, they are set such +that width * height is equal to the option "output.size" in tmap_options(). +This is by default 49, meaning that is the map is a square (so aspect ratio of 1) +both width and height are set to 7.

    units
    -

    units for width and height ("in", "cm", or "mm"). By default, pixels ("px") are used if either width or height is set to a value greater than 50. Else, the units are inches ("in")

    +

    units for width and height ("in", "cm", or "mm"). +By default, pixels ("px") are used if either width or height is set to a +value greater than 50. Else, the units are inches ("in").

    dpi
    -

    dots per inch. Only applicable for raster graphics. By default it is set to 300, but this can be changed using the option "output.dpi" in tmap_options().

    +

    dots per inch. Only applicable for raster graphics. By default it +is set to 300, but this can be changed using the option "output.dpi" in tmap_options().

    outer.margins
    @@ -110,7 +129,8 @@

    Argumentstm_layout(). Tip: set to 0 if map frame should be placed on the edges of the image.

    +

    if specified, it overrides the asp argument of tm_layout(). +Tip: set to 0 if map frame should be placed on the edges of the image.

    scale
    @@ -118,11 +138,15 @@

    Argumentsviewport of an inset map, or a list of viewports of multiple inset maps. The number of viewports should be equal to the number of tmap objects specified with insets_tm.

    +

    viewport of an inset map, or a list +of viewports of multiple inset maps. The number of +viewports should be equal to the number of tmap objects specified with insets_tm.

    add.titles
    @@ -130,19 +154,30 @@

    Argumentswidgetframe::saveWidgetframe() for details. By default FALSE which means that one large HTML file is saved (see saveWidget()).

    +

    should an interactive map be saved as an iframe? +If so, two HTML files will be saved; one small parent HTML file with the +iframe container, and one large child HTML file with the actual widget. +See widgetframe::saveWidgetframe() for details. By default FALSE, +which means that one large HTML file is saved (see saveWidget()).

    selfcontained
    -

    when an interactive map is saved, should the resources (e.g. JavaScript libraries) be contained in the HTML file? If FALSE, they are placed in an adjacent directory (see also htmlwidgets::saveWidget()). Note that the HTML file will often still be large when selfcontained = FALSE, since the map data (polygons and popups), which are also contained in the HTML file, usually take more space then the map resources.

    +

    when an interactive map is saved, should the resources +(e.g. JavaScript libraries) be contained in the HTML file? If FALSE, they +are placed in an adjacent directory (see also htmlwidgets::saveWidget()). +Note that the HTML file will often still be large when selfcontained = FALSE, +since the map data (polygons and popups), which are also contained in the HTML file, +usually take more space then the map resources.

    verbose
    -

    Deprecated. It is now controlled by the tmap option show.messages (see tmap_options())

    +

    Deprecated. It is now controlled by the tmap option show.messages +(see tmap_options())

    ...
    -

    arguments passed on to device functions or to saveWidget() or saveWidgetFrame()

    +

    arguments passed on to device functions or to +saveWidget() or saveWidgetFrame()

    diff --git a/dev/reference/tmap_style.html b/dev/reference/tmap_style.html index b9d5bcb4..734e7ac4 100644 --- a/dev/reference/tmap_style.html +++ b/dev/reference/tmap_style.html @@ -1,5 +1,11 @@ -Set or get the default tmap style — tmap_style • tmapSet or get the default tmap style — tmap_style • tmap @@ -53,7 +59,10 @@

    -

    Set or get the default tmap style. Without arguments, the current style is returned. Also the available styles are displayed. When a style is set, the corresponding tmap options (see tmap_options()) will be set accordingly. The default style (i.e. when loading the package) is "white".

    +

    Set or get the default tmap style. Without arguments, the current style is returned. +Also the available styles are displayed. When a style is set, the corresponding tmap +options (see tmap_options()) will be set accordingly. +The default style (i.e. when loading the package) is "white".

    @@ -64,7 +73,11 @@

    Usage

    Arguments

    style
    -

    Name of the style. When omitted, tmap_style() returns the current style and also shows all available styles. When the style is specified, tmap_style() sets the style accordingly. Note that in that case, all tmap options (see tmap_options()) will be reset according to the style definition. See tm_layout() for predefined styles, and tmap_style_catalogue (not migrated to v4 yet) for creating a catalogue.

    +

    Name of the style. When omitted, tmap_style() returns the current style +and also shows all available styles. When the style is specified,tmap_style() +sets the style accordingly. Note that in that case, all tmap options (see tmap_options()) +will be reset according to the style definition. +See tm_layout() for predefined styles, and tmap_style_catalogue (not migrated to v4 yet) for creating a catalogue.

    @@ -75,13 +88,18 @@

    Value

    Details

    -

    Note that tm_style() is used within a plot call (so it only affects that plot), whereas tmap_style() sets the style globally.

    -

    After loading a style, the options that defined this style (i.e. the difference with the default "white" style) can be obtained by tmap_options_diff().

    -

    The documentation of tmap_options() (details and the examples) shows how a new style is created.

    +

    Note that tm_style() is used within a plot call (so it only affects that plot), +whereas tmap_style() sets the style globally.

    +

    After loading a style, the options that defined this style +(i.e. the difference with the default "white" style) can be obtained by tmap_options_diff().

    +

    The documentation of tmap_options() (details and the examples) shows how to create a new style.

    See also

    -

    tmap_options() for tmap options, and tmap_style_catalogue (not migrated to v4 yet) to create a style catalogue of all available styles.

    +
    +
    • tmap_options() for tmap options

    • +
    • tmap_style_catalogue (not migrated to v4 yet) to create a style catalogue of all available styles.

    • +
    diff --git a/dev/search.json b/dev/search.json index c757cb3c..104d1925 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"extendability","dir":"Articles","previous_headings":"","what":"Extendability","title":"tmap v4: a sneak peek","text":"First foremost, tmap v4 fully extendable. precisely, following aspects can extended: Map layers: limited anymore fixed set tm_polygons(), tm_lines(), tm_symbols(), tm_raster() (derivatives tm_borders() tm_dots()), layer interest can developed extension tmap. illustrate tm_cartogram(). layers worthwhile implement tm_donuts(), tm_hexagons(), tm_network(), tm_hillshade(), etc. Aesthetics: many visual variables available. illustrate next section, already implemented 5 new aesthetics tm_polygons(). Moreover, much easier developers add new visual variables map layer functions. Graphics Engine: tmap v3 contains two modes: plot view (based grid graphics leaflet respectively) framework makes possible add modes well. Spatial data classes: tmap v3 build sf stars. also case tmap v4, developers, easier incorporate classes well, like SpatRaster SpatVector terra.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"aesthetics","dir":"Articles","previous_headings":"","what":"Aesthetics","title":"tmap v4: a sneak peek","text":"mentioned , added aesthetics (visual variables), easier developers add new aesthetics. reordered arguments specify configure aesthetics illustrated . arguments specify aesthetics remain . E.g., main aesthetic tm_polygons() fill, defines fill color polygons. However, arguments layer functions organized differently. Thus, aesthetic four arguments: aesthetic (fill) scale (fill.scale) legend (fill.legend) argument decides whether scales applied freely across facets (fill.free) scales legends discussed next sections. can see basic comparison tmap version 3 4 syntax: tmap v4, tm_polygons() aesthetics fill, col, fill_alpha, col_alpha, lwd, lty, eventually also pattern. standard map layers also additional aesthetics. data variable can mapped , using different scales (see next section overview). next example uses fill, lwd (line width), lty (line type) aesthetics: Besides visual mapping aesthetics, map data variables visual variables, also another group aesthetics, namely (data-driven) transformation aesthetics. used transform spatial objects. call data-driven, content data used input spatial transformation. example cartogram, shown next section. polygons distorted size (approximately) proportional data variable.","code":"# tmap v3 tm_shape(World) + tm_polygons(fill = \"HPI\", palette = \"Earth\", title = \"Happy Planet Index\") # tmap v4 tm_shape(World) + tm_polygons(fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\")) # tmap v3 # ... not possible :( # tmap v4 World$life_exp_class = cut(World$life_exp, breaks = seq(40, 85, by = 15)) tm_shape(World, crs = \"+proj=eck4\") + tm_polygons(fill = \"HPI\", fill.scale = tm_scale_continuous(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\"), lwd = \"well_being\", lwd.scale = tm_scale_continuous(value.neutral = 1, values = c(0, 5), label.na = \"\"), lwd.legend = tm_legend(title = \"Well Being\"), lty = \"life_exp_class\", lty.scale = tm_scale_ordinal(values = c(\"dotted\", \"dashed\", \"solid\"), value.na = \"blank\", value.neutral = \"solid\", label.na = \"\"), lty.legend = tm_legend(title = \"Life Expectancy\") )"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"map-layers-e-g--cartogram","dir":"Articles","previous_headings":"","what":"Map layers (e.g. cartogram)","title":"tmap v4: a sneak peek","text":"easy developers add new map layers extension. illustrate new map layer, tm_cartogram(). Cartograms already made tmap v3, explicitly required transforming data using cartogram package mapping. tmap v4, direct function tm_cartogram() (using cartogram package hood), uses transformation aesthetic size inherits visual aesthetics tm_polygons(): nice benefit cartograms directly tmap makes possible use available scaling functions. example, suppose want apply log 10 scale order make cartogram bit “balanced”:","code":"# tmap v3 library(cartogram) World_carto = World |> sf::st_transform(World, crs = \"+proj=eck4\") |> cartogram_cont(weight = \"pop_est\") tm_shape(World_carto, crs = \"+proj=eck4\") + tm_polygons(fill, palette = \"Earth\", title = \"Happy Planet Index\") # tmap v4 if (requireNamespace(\"cartogram\")) { tm_shape(World, crs = \"+proj=eck4\") + tm_cartogram(size = \"pop_est\", fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\")) + tm_place_legends_right(width = 0.2) } # tmap v3 library(cartogram) World_carto = World |> sf::st_transform(World, crs = \"+proj=eck4\") |> dplyr::mutate(pop_est_log10 = log10(pop_est)) |> cartogram_cont(weight = \"pop_est_log10\") tm_shape(World_carto) + tm_polygons(fill, palette = \"Earth\", title = \"Happy Planet Index\") # tmap v4 if (requireNamespace(\"cartogram\")) { tm_shape(World, crs = \"+proj=eck4\") + tm_cartogram(size = \"pop_est\", size.scale = tm_scale_continuous_log1p(), fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\")) + tm_place_legends_right(width = 0.2) }"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"scales","dir":"Articles","previous_headings":"","what":"Scales","title":"tmap v4: a sneak peek","text":"Scales used map data variables visual variables. Scales new map v4, used explicitly. following table shows scales currently available: main data type (second column) data type scale supposed applied. scale can applied data type (even though might make sense), one exception: continuous (log10) scales applied visual variables can take finite set values. Examples symbol shape line type. default, tm_scale_categorical(), tm_scale_ordinal(), tm_scale_intervals() used data class factor, ordered numeric respectively. Scales date/time variables included well. main argument scale function values, values visual variables. following table shows type values required visual variable: default values depend visual variable, also scale whether data values diverging. instance, tm_scale_intervals() applied numeric variable negative positive values visual variable fill, diverging color palette used. following map illustrates happens six scale functions applied data variable. use variable life expectancy (round order make sure number unique values limited): Scales existed tmap v3, applied implicitly via several arguments:","code":"data(World) Africa = World[World$continent == \"Africa\", ] Africa$life_exp = round(Africa$life_exp) # tmap v3 tm_shape(Africa) + tm_polygons(rep(\"life_exp\", 5), style = c(\"cat\", \"cat\", \"pretty\", \"cont\", \"log10\"), palette = list(\"Set2\", \"YlOrBr\", \"YlOrBr\", \"YlOrBr\", \"YlOrBr\"), title = \"\") + tm_layout(panel.labels = c(\"categorical scale\", \"ordinal scale\", \"intervals scale\", \"continuous scale\", \"log10 scale\"), inner.margins = c(0.05, 0.2, 0.1, 0.05), legend.text.size = 0.5) # discrete scale is not possible directly, but only via interval breaks: tm_shape(Africa) + tm_polygons(\"life_exp\", style = \"fixed\", palette = \"YlOrBr\", breaks = 49:76, as.count = TRUE, title = \"\") + tm_layout(panel.labels = \"discrete scale\", inner.margins = c(0.05, 0.2, 0.1, 0.05), legend.text.size = 0.5) # tmap v4 tm_shape(Africa) + tm_polygons(rep(\"life_exp\", 6), fill.scale = list(tm_scale_categorical(), tm_scale_ordinal(), tm_scale_intervals(), tm_scale_continuous(), tm_scale_continuous_log(), tm_scale_discrete()), fill.legend = tm_legend(title = \"\", position = tm_pos_in(\"left\", \"top\"))) + tm_layout(panel.labels = c(\"tm_scale_categorical\", \"tm_scale_ordinal\", \"tm_scale_intervals\", \"tm_scale_continuous\", \"tm_scale_continuous_log\", \"tm_scale_discrete\"), inner.margins = c(0.05, 0.2, 0.1, 0.05), legend.text.size = 0.5)"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"multivariate-scales","dir":"Articles","previous_headings":"","what":"Multivariate Scales","title":"tmap v4: a sneak peek","text":"possible assign multiple variables one aesthetic. can done function tm_mv() (stands multivariate). example bivariate choropleth, yet implemented, definitely . Another example multivariate aesthetics glpys, small charts used symbols. following example donut map. current implementation ‘one-trick-pony’ (see https://github.com/mtennekes/donutmaps) tmap v4 much easier:","code":"# tmap v4 tm_shape(World) + tm_symbols( fill = tm_mv(\"well_being\", \"footprint\"), fill.scale = tm_scale_bivariate(scale1 = tm_scale_intervals(breaks = c(2, 5, 6, 8)), scale2 = tm_scale_intervals(breaks = c(0, 3, 6, 20)), values = \"brewer.qualseq\") ) ## Labels abbreviated by the first letters, e.g.: \"0 to 3\" => \"0\" # tmap v4 (not implemented yet) library(tmap) library(tmapGlyps) # which include tm_donuts library(sfnetworks) # for origin-destination data methods tm_mode(\"view\") tm_shape(edges) + tm_halflines(lwd = \"flow\", col = \"dest\", start = 0.5, end = 1.0) + tm_shape(nodes) + tm_donuts(size = \"emplyoees\", parts = tm_mv(\"Amsterdam\", \"Rotterdam\", \"The Hague\", \"Utrecht\", \"Other_municipality\", \"Home_municipality\"))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"legends","dir":"Articles","previous_headings":"","what":"Legends","title":"tmap v4: a sneak peek","text":"may noticed previous examples, legends look bit differently default.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"positioning","dir":"Articles","previous_headings":"Legends","what":"Positioning","title":"tmap v4: a sneak peek","text":"Legends currently placed outside map default tmap v4. ? Simply often space inside map. Furthermore, possible place legends different locations across map: tmap v3 contains many (often complicated) options rather simple things. options set globally via tmap_options() within single plot tm_layout(). tmap v4, directly related layout accessible via tm_layout(). However, ease use, bunch handy shortcut functions, tm_place_legends_left():","code":"# tmap v3 # ... not possible :( # tmap v4 tm_shape(World) + tm_symbols(fill = \"HPI\", size = \"pop_est\", shape = \"income_grp\", size.scale = tm_scale(value.neutral = 0.5), fill.legend = tm_legend(\"Happy Planet Index\", position = tm_pos_in(\"left\", \"top\")), size.legend = tm_legend(\"Population\", position = tm_pos_out(\"left\", \"center\")), shape.legend = tm_legend(\"Income Group\", position = tm_pos_out(\"center\", \"bottom\"))) # tmap v3 tm_shape(World) + tm_symbols(fill = \"HPI\", size = \"pop_est\", shape = \"income_grp\") + tm_layout(legend.outside.position = \"left\", legend.outside.size = 0.2) # tmap v4 tm_shape(World) + tm_symbols(fill = \"HPI\", size = \"pop_est\", shape = \"income_grp\", size.scale = tm_scale(value.neutral = 0.5)) + tm_place_legends_left(0.2)"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"combined-legends","dir":"Articles","previous_headings":"Legends","what":"Combined legends","title":"tmap v4: a sneak peek","text":"Another new feature possibility combine legends directly, quite hassle tmap v3.","code":"# tmap v3 tm_shape(metro) + tm_symbols(col = \"pop2020\", n = 4, size = \"pop2020\", legend.size.show = FALSE, legend.col.show = FALSE) + tm_add_legend(\"symbol\", col = RColorBrewer::brewer.pal(4, \"YlOrRd\"), border.col = \"grey40\", size = ((c(10, 20, 30, 40) * 1e6) / 40e6) ^ 0.5 * 2, labels = c(\"0 mln to 10 mln\", \"10 mln to 20 mln\", \"20 mln to 30 mln\", \"30 mln to 40 mln\"), title = \"Population in 2020\") + tm_layout(legend.outside = TRUE, legend.outside.position = \"bottom\") # tmap v4 tm_shape(metro) + tm_symbols(fill = \"pop2020\", fill.legend = tm_legend(\"Population in 2020\"), size = \"pop2020\", size.scale = tm_scale_intervals(), size.legend = tm_legend_combine(\"fill\"))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"spacing-between-items","dir":"Articles","previous_headings":"Legends","what":"Spacing between items","title":"tmap v4: a sneak peek","text":"design legends () improved. prominently, space argument determines height legend item. specifically, legend item 1 + space line-height. also useful make continuous legends better.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"facets","dir":"Articles","previous_headings":"","what":"Facets","title":"tmap v4: a sneak peek","text":"tmap v4, convenient wrappers tm_facet_wrap() tm_facet_grid(), former wraps facets, latter places facets grid layout. Furthermore, visual variable free argument, determines whether scales free (TRUE) shared (FALSE) across facets. tmap v3 free argument set via tm_facets(), whereas tmap v4 argument moved layer functions: New tmap v4 facet grid, free argument can specified differently rows columns, show next complex (sorry ) example: see map life expectancy shown polygon fill green, GDP per capita red bubbles. maps grouped income group (rows) economy (columns). scale life expectancy set free columns. means scale applied column separately, legend per column. scale GDP per capita applied separately row.","code":"# tmap v3 tm_shape(World) + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\") + tm_facets(\"continent\", nrow = 1, free.scales.fill = FALSE, free.coords = FALSE) # tmap v4 tm_shape(World, crs = \"+proj=robin\") + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\", fill.free = FALSE) + tm_facets_wrap(\"continent\") # tmap v3 tm_shape(World) + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\") + tm_facets(\"continent\", nrow = 1, free.scales.fill = TRUE, free.coords = FALSE) tm_shape(World, crs = \"+proj=robin\") + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\", fill.free = TRUE) + tm_facets_stack(\"continent\") # tmap v3 # ... not possible :( # tmap v4 tm_shape(World, crs = \"+proj=robin\") + tm_borders() + tm_shape(World) + tm_polygons(fill = \"life_exp\", fill.scale = tm_scale_intervals(values = \"brewer.greens\"), fill.free = c(rows = FALSE, columns = TRUE)) + tm_symbols(size = \"gdp_cap_est\", size.free = c(rows = TRUE, columns = FALSE), fill = \"red\") + tm_facets_grid(\"income_grp\", \"economy\") + tm_layout(meta.margins = c(.2, 0, 0,.1))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"graphic-engines-modes","dir":"Articles","previous_headings":"","what":"Graphic Engines (modes)","title":"tmap v4: a sneak peek","text":"Just like tmap v3, \"plot\" \"view\" mode. However, framework used tmap v4 also facilitates developers write plotting methods modes. instance, CesiumJS great JavaScript library 3d globe visualizations. awesome include R. low-level interface CesiumJS R (similar R package leaflet interface JS library leaflet R), relatively easy developers add new mode 3d visualizations tmap v4.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"backward-compatibility","dir":"Articles","previous_headings":"","what":"Backward compatibility","title":"tmap v4: a sneak peek","text":"early development stage, tmap v3 code work tmap v4. However, tmap v4 stable, backwards compatible. Layer function arguments longer used, breaks palette deprecated, internally redirected new scale functions. Furthermore, options options tmap v4. instance, legends placed outside maps default, small space legend items shown . order keep layout close possible tmap v3, style set options back settings used default tmap v3. can set just one command: tmap_style(\"tmap_v3\")","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"color-palettes","dir":"Articles","previous_headings":"","what":"Color palettes","title":"tmap v4: a sneak peek","text":"huge number directly available color palettes. settled exact details, e.g. palettes include, can obtained. Ideas welcome (https://github.com/r-tmap/tmap/issues/566). current development version, function similar tmaptools::palette_explorer(), renders long png viewer pane RStudio browser: (click image see full png) also possible render color blindness simulation, e.g.: tmap_show_palettes(color_vision_deficiency = \"deutan\"). default palettes use usable color blind people.","code":"# tmap v4 tmap_show_palettes()"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"suggestions","dir":"Articles","previous_headings":"","what":"Suggestions","title":"tmap v4: a sneak peek","text":"suggestions? Please let us know! Via https://github.com/r-tmap/tmap/issues, please use tmap_v4 tag.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"tmap: visual variables","text":"tmap R package spatial data visualization. vignette describes alpha version major update (version 4), CRAN course 2023.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"tmap-4---tmap-3-x","dir":"Articles","previous_headings":"Introduction","what":"tmap 4 - tmap 3.x","title":"tmap: visual variables","text":"tmap 3.x supports several map layer variables, example \"col\", \"size\", \"shape\" tm_symbols() map layer function. many variables tmap 4. Besides visual variables, -called transformation variables also available. transformation variable role change spatial coordinates (instance, create cartogram). visual variable changes appearance spatial object, e.g. fill color line width. can find examples variables . Map layer arguments (e.g. arguments tm_polygons()) much better organized: visual/transformation variable, four arguments. case fill visual variable, : fill, fill.scale, fill.legend fill.free, respectively specify data variable visual value defines polygon fill color, used scaling function, legend layout, whether scales applied freely across facets. input visual/transformation variable can multivariate, sense multiple data variables scaled one transformation visual variable. example bivariate choropleth, cross tabulation two data variables mapped one (bivariate) color palette. User-defined map layer functions can written (e.g. extension package). Like tmap 3.x, tmap 4.0 comes two modes, \"plot\" \"view\" mode. However, modes can added well, may expect extension package tmap.rayshader point (start writing one ). Legends map components (scale bars) can drawn anywhere outside map. layout legends improved made much flexible. possible combine legends, useful data variable applied multiple visual variables using scaling function.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"tmap-4---ggplot2","dir":"Articles","previous_headings":"Introduction","what":"tmap 4 - ggplot2","title":"tmap: visual variables","text":"tmap package similar ggplot2 Grammar Graphics, tailored spatial data visualization, whereas ggplot2 much general. specifically: tmap, visual/transformation variables always specifies map layer functions, whereas ggplot2 aesthetics usually specified plot level. ggplot2, scales determined plot level, whereas tmap, determined map layer level. tmap, spatial data (e.g. sf object) specified tm_shape(). spatial coordinates (x y) considered part data (can changed transformation variables). principle, map layer function can used spatial class. E.g. tm_dots() renders dots sf points data, also works spatial classes: e.g. centroids sf polygons/lines raster data (stars / terra packages). However, ggplot2::ggplot(), spatial class requires custom map layer function, e.g. ggplot2::geom_sf() sf objects. tmap static plot mode interactive mode. …","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"tmap-4---other-r-packages","dir":"Articles","previous_headings":"Introduction","what":"tmap 4 - other R packages","title":"tmap: visual variables","text":"several great R packages spatial data visualization, including: ggplot2, mapview, leaflet, mapsf, generic plot function. interactive \"view\" mode tmap similar mapview sense uses building blocks (packages like leaflet, leafsync, leafgl). Colors important data visualization. purpose, tmap uses cols4all, new R package analyse color palettes, check color-blind-friendliness properties.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"map-layers","dir":"Articles","previous_headings":"","what":"Map layers","title":"tmap: visual variables","text":"(thematic) map consists one map layers. map layer specific set variables determine objects layer drawn. distinguish two type variables: transformation variables visual variables. transformation variable used change spatial coordinates (instance, cartogram distorts polygons). visual variable changes appearance spatial object, e.g. fill color line width. Transformation variables used specific map layers cartogram, whereas visual variables used almost map layers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"visual-variables","dir":"Articles","previous_headings":"","what":"Visual variables","title":"tmap: visual variables","text":"visual variable describes certain visual property drawn object, color, size, shape, line width, line stroke, transparency, fill pattern (ggplot2 called aesthetics). visual variable can specified using constant value (e.g. fill = \"blue\") data-driven (later). can specified constant value, called visual constant. following table shows visual variables used standard map layers. New tmap 4.0 users can write custom map layer functions; another vignette. Important now map layers visual variables can extended needed.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"constant-visual-values","dir":"Articles","previous_headings":"Visual variables","what":"Constant visual values","title":"tmap: visual variables","text":"following code draws gold country polygons. visual variables mentioned previous table used, constant values. instance, polygon borders drawn width lwd colored col. visual variables default value, case border width color respectively 1 \"black\". visual variable specified different value fill, set \"gold\". completely new tmap: function tm_shape() specifies spatial data object, can spatial data object packages sf, stars, terra, sp, raster. subsequent map layer functions (stacked + operator) specify spatial data visualized. next example three layers: basemap OpenTopoMap, country polygon boundaries, dots metropolitan areas: visual variable argument can also specified data variable (e.g., column name). happens case values data variable mapped values corresponding visual variable. example, life expectancy per country shown, put precisely: data variable life expectancy mapped visual variable polygon fill. understand data mapping, consider following schematic dataset: first column contains spatial geometries (case polygons, can also points, lines, raster tiles). second column data variable like show. third column contains visual values, case colors. Important note many ways scale data values visual values. example data values put 5 year intervals sequential discrete blue scale used show . tm_scale_*() family functions, users free create scales. map uses continuous color scale colors CARTO. scales later.","code":"tm_shape(World) + tm_polygons(\"gold\") if (requireNamespace(\"maptiles\")) { tm_basemap(server = \"OpenTopoMap\", zoom = 2, alpha = 0.5) + tm_shape(World, bbox = sf::st_bbox(c(xmin = -180, xmax = 180, ymin = -86, ymax = 86))) + tm_polygons(fill = NA, col = \"black\") + tm_shape(metro) + tm_symbols(size = 0.1, col = \"red\") + tm_layout(inner.margins = rep(0, 4)) } ## Loading required namespace: maptiles tm_shape(World) + tm_polygons(\"life_exp\") ## geom x1 vv1 ## 1 polygon1 72 blue6 ## 2 polygon2 58 blue3 ## 3 polygon3 52 blue2 ## 4 polygon4 73 blue7 ## 5 ... ... ... tm_shape(World) + tm_polygons(\"life_exp\", fill.scale = tm_scale_continuous(values = \"-carto.earth\"), fill.legend = tm_legend(\"Life\\nExpectancy\"))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"transformation-variables","dir":"Articles","previous_headings":"","what":"Transformation variables","title":"tmap: visual variables","text":"Besides visual variables, map layer may use spatial transformation variables. used two variables: size deform polygons using continuous cartogram fill color polygons. former example transformation variable. example schematic dataset: data variable x1, example pop_est (population estimation), scaled x1_scaled case normalization using continuous scale. Next, geometries distorted areas proportional x1_scaled (much cartogram algorithm able achieve).","code":"if (requireNamespace(\"cartogram\")) { tm_shape(World, crs = 8857) + tm_cartogram(size = \"pop_est\", fill = \"income_grp\") } ## Loading required namespace: cartogram ## Cartogram in progress... ## geom x1 x_scaled geom_transformed ## 1 polygon1 491,775 0.0007 polygon1' ## 2 polygon2 2,231,503 0.0033 polygon2' ## 3 polygon3 34,859,364 0.0554 polygon3' ## 4 polygon4 4,320,748 0.0067 polygon4' ## 5 ... ... ... ..."},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"scales","dir":"Articles","previous_headings":"","what":"Scales","title":"tmap: visual variables","text":"visual variable transformation variable can scaled one tm_scale_ functions. illustrate different options, show life expectancy across Africa, round order use categorical scales well. Like tmap 3.x, possible create facets specifying multiple data variable names scales one visual (transformation) variable, case \"fill\": tm_scale_categorical() tm_scale_ordinal() tread data categorical data, ignoring fact actually numbers. difference categorical assume order categories, whereas ordinal . similar factor R can ordered . shown scales can applied numeric data. Note example breaks tm_scale_intervals() similar tick marks tm_scale_continous(). However, using class intervals colors used (case 6 plus color missing values) whereas continuous scale gradient colors used. advantage using class intervals relatively easy read data values map, e.g. value South Africa 55 60, advantage using continuous color scale colors map accurate (unrounded). tm_scale_intervals() possible chose determine breaks (argument style). tm_scale_continous() possible use transformation function: case built-log transformation used (pretty useless particular example data range). Finally, tm_scale_discrete() uses discrete linear scale. Note different tm_scale_ordinal(), use colors values present (categories), instance 53. tm_scale_*() functions can (principle) applied visual transformation variable. Note different ggplot2 scales organized variable type (e.g. ggplot2::scale_fill_continuous()). related another difference ggplot2. tmap, scales set directly map layer function target visual/transformation variable, instance tm_polygons(fill = \"x\", fill.scale = tm_scale_continuous()). ggplot(), scales set outside layer functions. tm_scale_ function (least) following arguments: values, values.repeat, values.range, values.scale, value.na, value.null, value.neutral, labels, label.na, label.null, label.format. value* arguments determine visual values data values mapped. case scale applied visual variable represents color, takes color values color palette. However, instance scale applied line width, values numeric values represent line widths. illustrated following example: defaults value.* arguments stored tmap options. instance contains default color palettes visual variable \"fill\" different types data. instance, data values positive numbers, tm_scale_intervals() tm_scale_continuous() applied, default color palette \"hcl.blues3\", can seen examples . Regarding available color palettes: tmap uses new R package cols4all contains large number well-known color palettes. Please run cols4all::c4a_gui() starts interactive tool (successor tmaptools::palette_explorer()). course, also color palettes can loaded directly via vector color codes.","code":"data(World) Africa = World[World$continent == \"Africa\", ] Africa$life_exp = round(Africa$life_exp) tm_shape(Africa) + tm_polygons(rep(\"life_exp\", 6), fill.scale = list(tm_scale_categorical(), tm_scale_ordinal(), tm_scale_intervals(), tm_scale_continuous(), tm_scale_continuous_log(), tm_scale_discrete()), fill.legend = tm_legend(title = \"\", position = tm_pos_in(\"left\", \"top\"))) + tm_layout(panel.labels = c(\"tm_scale_categorical\", \"tm_scale_ordinal\", \"tm_scale_intervals\", \"tm_scale_continuous\", \"tm_scale_continuous_log\", \"tm_scale_discrete\"), inner.margins = c(0.05, 0.4, 0.1, 0.05), legend.text.size = 0.5) tm_shape(World) + tm_polygons(fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"scico.roma\", value.na = \"grey95\", breaks = c(12,20,30,45))) + tm_symbols(size = \"HPI\", size.scale = tm_scale_intervals(values = c(0.3,0.5, 0.8), value.na = 0.1, breaks = c(12,20,30,45)), col = \"grey30\") tmap_options(\"values.var\")$values.var$fill ## $seq ## [1] \"hcl.blues3\" ## ## $div ## [1] \"pu_gn_div\" ## ## $unord ## [1] \"tol.muted\" ## ## $ord ## [1] \"hcl.blues3\" ## ## $cyc ## [1] \"tol.rainbow_pu_rd\" ## ## $biv ## [1] \"pu_gn_bivs\""},{"path":"https://r-tmap.github.io/tmap/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Martijn Tennekes. Author, maintainer. Jakub Nowosad. Contributor. Joel Gombin. Contributor. Sebastian Jeworutzki. Contributor. Kent Russell. Contributor. Richard Zijdeman. Contributor. John Clouse. Contributor. Robin Lovelace. Contributor. Jannes Muenchow. Contributor. Olivier Roy. Contributor.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tennekes M (2018). “tmap: Thematic Maps R.” Journal Statistical Software, 84(6), 1–39. doi:10.18637/jss.v084.i06.","code":"@Article{, title = {{tmap}: Thematic Maps in {R}}, author = {Martijn Tennekes}, journal = {Journal of Statistical Software}, year = {2018}, volume = {84}, number = {6}, pages = {1--39}, doi = {10.18637/jss.v084.i06}, }"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"tmap-thematic-maps-in-r-","dir":"","previous_headings":"","what":"Thematic Maps","title":"Thematic Maps","text":"tmap actively maintained open-source R-library drawing thematic maps. API based Layered Grammar Graphics resembles syntax ggplot2, popular R-library drawing charts. See source code images.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Thematic Maps","text":"tmap available . Installation straightforward: Linux macOS users new working spatial data R, may fail since additional (non-R) libraries required (automatically installed Windows users). Windows additional installation required. Linux (Ubuntu) See https://geocompx.org/post/2020/installing-r-spatial-packages-linux/. Please address installation issues issue. macOS See http://www.kyngchaos.com. Please address installation issues issue.","code":"install.packages(\"tmap\")"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"development","dir":"","previous_headings":"","what":"Development","title":"Thematic Maps","text":"latest development version can installed using remotes. order use development version tmap, recommended use development version tmaptools well: See NEWS latest features improvements issue list discussions enhancements bugs. want help development package? Please let us know! feedback, requests, tips, bug reports welcome!","code":"# install.packages(\"remotes\") install_github(\"r-tmap/tmaptools\") install_github(\"r-tmap/tmap\") # On Linux, with pak # install.packages(\"pak\") pak::pak(\"r-tmap/tmap\") # Or from r-universe install.packages('tmap', repos = c('https://r-tmap.r-universe.dev', 'https://cloud.r-project.org'))"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Thematic Maps","text":"","code":"library(tmap)"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"reference","dir":"","previous_headings":"","what":"Reference","title":"Thematic Maps","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39 paper written tmap 1.11-2. See reproducible code using tmap 2.x.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"vignettes","dir":"","previous_headings":"","what":"Vignettes","title":"Thematic Maps","text":"tmap v3: get started! tmap: changed recent versions?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Thematic Maps","text":"tmap RMarkdown","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"presentations","dir":"","previous_headings":"","what":"Presentations","title":"Thematic Maps","text":"Creating thematic maps R (OpenGeoHUB Summer School 2019) Plotting spatial data R (eRum 2018) Exploring presenting maps tmap (useR!2017) tmap: creating thematic maps flexible way (useR!2015)]","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"other-resources","dir":"","previous_headings":"","what":"Other resources","title":"Thematic Maps","text":"Geocomputation R; Making maps R, Robin Lovelace, Jakub Nowosad, Jannes Muenchow R tip: Create maps R Working Spatial Data using tmap, Samantha . Alger Computer World: Mapping R just got whole lot easier National Socio-Environmental Synthesis Center: Maps R Introduction visualizing spatial data R Blog post SpatialControl Blog post TWIAV Computer World: Create maps R 10 (fairly) easy steps Computer World: Great R packages data import, wrangling visualization Tutorial Visualizing spatial data: base shiny - workshop Stack Overflow questions (#tmap)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"getting-help","dir":"","previous_headings":"","what":"Getting help","title":"Thematic Maps","text":"two main places get help tmap: stackoverflow great source answers common tmap questions. also great place get help, created reproducible example illustrates problem. Please tag questions tmap. request think problem caused bug, please open issue, preferably reproducible example.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":null,"dir":"Reference","previous_headings":"","what":"World and Netherlands map — World","title":"World and Netherlands map — World","text":"Maps world Netherlands (province municipality level), class sf","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"World and Netherlands map — World","text":"","code":"World NLD_prov NLD_muni"},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"World and Netherlands map — World","text":"https://www.naturalearthdata.com/ World https://happyplanetindex.org/ World https://www.cbs.nl/ NLD_prov NLD_muni.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"World and Netherlands map — World","text":"default projections maps Eckhart IV (World) Rijksdriehoekstelsel (Netherlands). See . projection can changed temporarily plotting purposes using projection argument tm_shape(). World World map. default projection world map Eckhart IV since area sizes preserved, important property choropleths. NLD_prov NLD_muni, maps Netherlands province municipality level 2013. used projection Rijksdriehoekstelsel projection. Important: publication maps allowed citing Statistics Netherlands (CBS) Kadaster Nederland source.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"World and Netherlands map — World","text":"Statistics Netherlands (2014), Hague/Heerlen, Netherlands, https://www.cbs.nl/. Kadaster, Netherlands' Cadastre, Land Registry, Mapping Agency (2014), Apeldoorn, Netherlands, https://www.kadaster.nl/.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/get_fact_levels_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","title":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","text":"Internal tmap function gets factor levels NA's","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/get_fact_levels_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","text":"","code":"get_fact_levels_na(x, o)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/get_fact_levels_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","text":"x vector o options","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatial data of global land cover — land","title":"Spatial data of global land cover — land","text":"Spatial data global land cover, percent tree cover, elevation class stars. Two attributes object relates global land cover. cover layer classifies status land cover whole globe 20 categories, cover_cls layer uses 8 simplified categories. Percent Tree Cover (trees) represents density trees ground, last attribute represents elevation.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of global land cover — land","text":"","code":"land"},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Spatial data of global land cover — land","text":"object class stars 1080 rows 540 columns.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spatial data of global land cover — land","text":"Important: publication maps allowed cited Tateishi et al. (2014), \"Geospatial Information Authority Japan, Chiba University collaborating organizations.\" shown.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Spatial data of global land cover — land","text":"Production Global Land Cover Data - GLCNMO2008, Tateishi, R., Thanh Hoan, N., Kobayashi, T., Alsaaideh, B., Tana, G., Xuan Phong, D. (2014), Journal Geography Geology, 6 (3).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/make_by_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function to create by variables (used for faceting) — make_by_vars","title":"Internal tmap function to create by variables (used for faceting) — make_by_vars","text":"Internal tmap function create variables (used faceting)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/make_by_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function to create by variables (used for faceting) — make_by_vars","text":"","code":"make_by_vars(dt, tmf, smeta)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/make_by_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to create by variables (used for faceting) — make_by_vars","text":"dt data.table tmf tmf object smeta smeta object","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatial data of metropolitan areas — metro","title":"Spatial data of metropolitan areas — metro","text":"metro includes population time series 1950 (forecasted) 2030. metro areas 1 million inhabitants 2010 included.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of metropolitan areas — metro","text":"","code":"metro"},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Spatial data of metropolitan areas — metro","text":"object class sf (inherits data.frame) 436 rows 13 columns.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Spatial data of metropolitan areas — metro","text":"https://population.un.org/wup/","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Spatial data of metropolitan areas — metro","text":"United Nations, Department Economic Social Affairs, Population Division (2014). World Urbanization Prospects: 2014 Revision, CD-ROM Edition.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tm_element.html","id":null,"dir":"Reference","previous_headings":"","what":"Print tm_element — print.tm_element","title":"Print tm_element — print.tm_element","text":"Print tm_element","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tm_element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print tm_element — print.tm_element","text":"","code":"# S3 method for tm_element print(x, ...) # S3 method for tm_shape print(x, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tm_element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print tm_element — print.tm_element","text":"x x ... passed ","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw thematic map — print.tmap","title":"Draw thematic map — print.tmap","text":"Draw thematic map.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw thematic map — print.tmap","text":"","code":"# S3 method for tmap print(x, return.asp = FALSE, show = TRUE, vp = NULL, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw thematic map — print.tmap","text":"x tmap object. return.asp aspect ratio returned? show show map vp viewport (\"plot\" mode) ... used","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":null,"dir":"Reference","previous_headings":"","what":"Quick thematic map plot — qtm","title":"Quick thematic map plot — qtm","text":"Draw thematic map quickly. function convenient wrapper main plotting method stacking tmap-elements. Without arguments search term, functions draws interactive map.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quick thematic map plot — qtm","text":"","code":"qtm( shp, fill = tm_const(), col = tm_const(), size = tm_const(), shape = tm_const(), lwd = tm_const(), lty = tm_const(), fill_alpha = tm_const(), col_alpha = tm_const(), by = NULL, scale = NULL, title = NULL, crs = NULL, bbox = NULL, basemaps = NULL, overlays = NULL, zindex = NA, group = NA, group.control = \"check\", style = NULL, format = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quick thematic map plot — qtm","text":"shp One shape object, object class defined sf stars package. Objects packages sp raster also supported, discouraged. specified, .e. qtm() executed. case plain interactive map shown. OpenStreetMap search string, e.g. qtm(\"Amsterdam\"). case plain interactive map shown positioned according results search query (OpenStreetMap nominatim) fill, col, size, shape, lwd, lty, fill_alpha, col_alpha Visual variables. data variable name data split, vector two variable names split data two variables (first used rows second columns). See also tm_facets() scale numeric value serves global scale parameter. font sizes, symbol sizes, border widths, line widths controlled value. parameters symbols.size, text.size, lines.lwd can scaled separately respectively symbols.scale, text.scale, lines.scale. See also .... title main title. legend titles, use X.style, X layer name (see ...). crs Either crs object character value (PROJ.4 character string). default, projection used defined shp object . bbox bounding box. Argument passed tm_shape() basemaps name(s) provider URL tiled basemap. shortcut tm_basemap(). Set NULL disable basemaps. default, set tmap option basemaps. overlays name(s) provider URL tiled overlay map. shortcut tm_tiles(). zindex zindex group group group.control group.control style Layout options (see tm_layout()) define style. See tmap_style() details. format Layout options (see tm_layout()) define format. See tmap_format() details. ... arguments passed tm_* functions. prefix arguments layer function name without \"tm_\" period. instance, palette polygon fill color called fill.palette. following prefixes supported: shape., fill., borders., polygons., symbols., dots., lines., raster., text., layout., grid., facets., view.. Arguments unique name, .e. exist layer function, e.g. convert2density, can also called without prefix.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quick thematic map plot — qtm","text":"tmap-element","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Quick thematic map plot — qtm","text":"first argument shape object (normally specified tm_shape()). next arguments, fill raster, aesthetics main layers. remaining arguments related map layout. argument main layer function, tm_polygons(), can specified (see ...). also possible stack tmap-elements qtm plot. See examples. default, scale bar shown. option can set tmap_options() (argument qtm.scalebar). minimap shown default qtm called without arguments search term. option can set tmap_options() (argument qtm.minimap).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Quick thematic map plot — qtm","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quick thematic map plot — qtm","text":"","code":"data(World, rivers, metro) # just the map qtm(World) # choropleth qtm(World, fill = \"economy\", format = \"World\", style = \"col_blind\", projection = \"+proj=eck4\") # choropleth with more specifications qtm(World, fill=\"HPI\", fill.n = 9, fill.palette = \"div\", fill.title = \"Happy Planet Index\", fill.id = \"name\", style = \"gray\", format = \"World\", projection = \"+proj=eck4\") # this map can also be created with the main plotting method, # which is recommended in this case. if (FALSE) { tm_shape(World, projection = \"+proj=eck4\") + tm_polygons(\"HPI\", n = 9, palette = \"div\", title = \"Happy Planet Index\", id = \"name\") + tm_style(\"gray\") + tm_format(\"World\") } # bubble map if (FALSE) { qtm(World, borders = NULL) + qtm(metro, symbols.size = \"pop2010\", symbols.title.size= \"Metropolitan Areas\", symbols.id= \"name\", format = \"World\") } # dot map if (FALSE) { current.mode <- tmap_mode(\"view\") qtm(metro, bbox = \"China\") tmap_mode(current.mode) # restore mode } if (FALSE) { # without arguments, a plain interactive map is shown (the mode is set to view) qtm() # search query for OpenStreetMap nominatim qtm(\"Amsterdam\") }"},{"path":"https://r-tmap.github.io/tmap/dev/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. leaflet providers","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatial data of rivers — rivers","title":"Spatial data of rivers — rivers","text":"Spatial data rivers","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of rivers — rivers","text":"","code":"rivers"},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Spatial data of rivers — rivers","text":"object class sf (inherits data.frame) 1616 rows 5 columns.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Spatial data of rivers — rivers","text":"https://www.naturalearthdata.com","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/shapeTM.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function to create a tmap shape — shapeTM","title":"Internal tmap function to create a tmap shape — shapeTM","text":"Internal tmap function create tmap shape","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/shapeTM.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function to create a tmap shape — shapeTM","text":"","code":"shapeTM(shp, tmapID = NULL, bbox = NULL, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/shapeTM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to create a tmap shape — shapeTM","text":"shp Shape file tmapID tmap Identifier bbox bounding box","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/theme_ps.html","id":null,"dir":"Reference","previous_headings":"","what":"ggplot2 theme for proportional symbols — theme_ps","title":"ggplot2 theme for proportional symbols — theme_ps","text":"ggplot2 theme proportional symbols. default, theme shows plotting area, without titles, axes, legend","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/theme_ps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ggplot2 theme for proportional symbols — theme_ps","text":"","code":"theme_ps( base_size = 12, base_family = \"\", plot.axes = FALSE, plot.legend = FALSE )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/theme_ps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ggplot2 theme for proportional symbols — theme_ps","text":"base_size base size base_family base family plot.axes axes shown? plot.legend legend(s) shown?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_add_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: manual legend — tm_add_legend","title":"Map component: manual legend — tm_add_legend","text":"Map component adds manual legend","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_add_legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: manual legend — tm_add_legend","text":"","code":"tm_add_legend( ..., labels, type = \"Symbols\", title = \"\", design = NULL, orientation = NULL, group = NA, group.control = \"check\", resize.as.group = FALSE, z = as.integer(NA) )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_add_legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: manual legend — tm_add_legend","text":"... visual variables arguments passed tm_legend. default, argument type set \"Symbols\", means supported visual variables : \"fill\", \"col\", \"shape\", \"size\", \"fill_alpha\", \"col_alpha\", \"lty\", \"lwd\", \"linejoin\", \"lineend\". labels labels type layer type visual variables (see ...) taken. Options: \"Symbols\" (default), \"Lines\", \"Polygons\", \"Text\". title text title design legend design orientation legend orientation group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). resize..group resize..group z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: basemap / overlay tiles — tm_basemap","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"Map layer draws tiles tile server. tm_basemap() draws tile layer basemap, .e. bottom layer. contrast, tm_tiles() draws tile layer overlay layer, stacking order corresponds order layer called, just like map layers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"","code":"tm_basemap( server = NULL, alpha = NULL, zoom = NULL, zindex = 0, group = NA, group.control = \"radio\" ) tm_tiles( server = NULL, alpha = NULL, zoom = NULL, zindex = NA, group = NA, group.control = \"check\" )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"server Name provider URL. list available providers can obtained providers (tip: RStudio, type providers$ see options). See https://leaflet-extras.github.io/leaflet-providers/preview/ preview . URL provided, template format, e.g. \"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\". Use NULL tm_basemap() disable basemaps. alpha Transparency level zoom Zoom level (used plot mode) zindex zindex pane view mode. default, set layer number plus 400. default, tmap layers therefore placed custom panes \"tmap401\", \"tmap402\", etc., except base tile layers, placed standard \"tile\". parameter determines name pane z-index, determines pane order bottom top. instance, zindex set 500, pane named \"tmap500\". group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"","code":"if (requireNamespace(\"maptiles\")) { tm_basemap() + tm_shape(World) + tm_polygons(\"HPI\") tm_basemap(\"OpenTopoMap\") + tm_shape(World) + tm_polygons(fill = NA, col = \"black\") } #> Loading required namespace: maptiles"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_cartogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: cartogram — tm_cartogram","title":"Map layer: cartogram — tm_cartogram","text":"Map layer draws cartogram","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_cartogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: cartogram — tm_cartogram","text":"","code":"tm_cartogram( size = 1, size.scale = tm_scale(), size.legend = tm_legend_hide(), size.free = NA, plot.order = tm_plot_order(\"size\", reverse = FALSE), trans.args = list(type = \"cont\", itermax = 15), ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_cartogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: cartogram — tm_cartogram","text":"size, size.scale, size.legend, size.free Transformation variable determines size polygons. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args lists passed internal transformation function ... Arguments passed tm_polygons fill,fill.scale,fill.legend,fill.free Visual variable determines fill color. See details. col,col.scale,col.legend,col.free Visual variable determines border color. See details. lwd,lwd.scale,lwd.legend,lwd.free Visual variable determines line width. See details. lty,lty.scale,lty.legend,lty.free Visual variable determines line type. See details. fill_alpha,fill_alpha.scale,fill_alpha.legend,fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha,col_alpha.scale,col_alpha.legend,col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin,lineend Line join line end. See gpar() details. trans.args,mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.col) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_compass.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: compass — tm_compass","title":"Map component: compass — tm_compass","text":"Map component adds compass","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_compass.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: compass — tm_compass","text":"","code":"tm_compass( north, type, text.size, size, show.labels, cardinal.directions, text.color, color.dark, color.light, lwd, position, bg.color, bg.alpha, stack, just, frame, frame.lwd, frame.r, margins, z )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_compass.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: compass — tm_compass","text":"north north type type text.size text.size size size show.labels show.labels cardinal.directions cardinal.directions text.color text.color color.dark color.dark color.light color.light lwd lwd position position bg.color bg.color bg.alpha bg.alpha stack stack just just frame frame frame.lwd frame.lwd frame.r frame.r margins margins z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_const.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap function to define a constant visual value — tm_const","title":"tmap function to define a constant visual value — tm_const","text":"tmap function define constant visual value","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_const.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap function to define a constant visual value — tm_const","text":"","code":"tm_const()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_credits.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: (credits) text — tm_credits","title":"Map component: (credits) text — tm_credits","text":"Map component adds text, typically used credits","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_credits.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: (credits) text — tm_credits","text":"","code":"tm_credits( text, size, color, padding, fontface, fontfamily, stack, just, frame, frame.lwd, frame.r, bg.color, bg.alpha, position, width, height, group.frame, resize.as.group, z )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_credits.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: (credits) text — tm_credits","text":"text text title size font size title color color padding padding fontface font face fontfamily font family stack stack just just frame frame frame.lwd frame.lwd frame.r frame.r bg.color bg.color bg.alpha bg.alpha position position width width height height group.frame group.frame resize..group resize..group z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_extra_innner_margin.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap layout: helper functions — tm_place_legends_right","title":"tmap layout: helper functions — tm_place_legends_right","text":"tmap layout: helper functions","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_extra_innner_margin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap layout: helper functions — tm_place_legends_right","text":"","code":"tm_place_legends_right(width = NA) tm_place_legends_left(width = NA) tm_place_legends_bottom(height = NA) tm_place_legends_top(height = NA) tm_place_legends_inside(pos.h = NULL, pos.v = NULL) tm_extra_innner_margin(left = 0, right = 0, top = 0, bottom = 0)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_extra_innner_margin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"tmap layout: helper functions — tm_place_legends_right","text":"width width height height pos.h, pos.v position (horizontal vertical) left, right, top, bottom extra margins","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_facets.html","id":null,"dir":"Reference","previous_headings":"","what":"Facets — tm_facets","title":"Facets — tm_facets","text":"Specify facets. tm_facets() core function, recommended use tm_facets_wrap(), tm_facets_stack() tm_facets_grid(). former two specify facets one grouping variable (one faceting dimension). difference wrap may place facets multiple rows columns whereas tm_facets_stack() stacks facets either horizontally vertically. tm_facets_grid() supports three faceting dimensions.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_facets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Facets — tm_facets","text":"","code":"tm_facets( by = NULL, rows = NULL, columns = NULL, pages = NULL, as.layers = FALSE, nrows = NA, ncols = NA, byrow = TRUE, orientation = NA, free.coords = NA, drop.units = TRUE, drop.empty.facets = TRUE, drop.NA.facets = FALSE, sync = TRUE, showNA = NA, textNA = \"Mssing\", scale.factor = 2, type = NA, along = NULL ) tm_facets_grid(rows = NULL, columns = NULL, pages = NULL, ...) tm_facets_wrap(by = \"VARS__\", nrows = NA, ncols = NA, byrow = TRUE, ...) tm_facets_pagewise(by = \"VARS__\", nrows = 1, ncols = 1, byrow = TRUE, ...) tm_facets_stack(by = \"VARS__\", orientation = NA, ...) tm_facets_hstack(by = \"VARS__\", ...) tm_facets_vstack(by = \"VARS__\", ...) tm_facets_flip()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_facets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Facets — tm_facets","text":"Group variable (facet wrap facet stack) rows Variable specifies rows (facet grid) columns Variable specifies columns (facet grid) pages Variable specifies pages (facet grid) .layers show facets layers? nrows Number rows ncols Number columns byrow facets wrapped row? orientation facet stack: horizontal vertical? free.coords Logical. argument specified, map coordinate ranges? default TRUE, unless facets shown different layers (.layers = TRUE) drop.units Logical. argument specified, non-selected spatial units dropped? FALSE, plotted mapped aesthetics regarded missing values. applicable raster shapes. default TRUE. drop.empty.facets Logical. argument specified, empty facets dropped? Empty facets occur -variable contains unused levels. TRUE two -variables specified, empty rows columns dropped. drop.NA.facets Logical. argument specified, data values specific facets missing, facets dropped? FALSE default. sync Logical. navigation view mode (zooming panning) synchronized? default TRUE facets bounding box. generally case rasters plotted, free.coords FALSE. showNA argument specified, missing values -variable shown facet? two -variables specified, missing values shown additional row column? NA, missing values shown exist. Similar useNA argument table(), TRUE, FALSE, NA correspond \"always\", \"\", \"ifany\" respectively. textNA Text used facets missing values. scale.factor Number determines elements (e.g. font sizes, symbol sizes, line widths) small multiples scaled relation scaling factor shapes. elements scaled scale.factorth root scaling factor shapes. , scale.factor=1, scaled proportional scaling shapes. Since elements, especially text, often small read, higher value recommended. default, scale.factor=2. type \"grid\", \"wrap\" \"stack\" along deprecated Please use tm_facets_page() ... passed tm_facets()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":null,"dir":"Reference","previous_headings":"","what":"Coordinate grid / graticule lines — tm_graticules","title":"Coordinate grid / graticule lines — tm_graticules","text":"Creates tmap-element draws coordinate grid lines. serves layer can drawn anywhere layers. default, tm_grid() draws horizontal vertical lines according coordinate system (master) shape object. Latitude longitude graticules drawn tm_graticules().","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coordinate grid / graticule lines — tm_graticules","text":"","code":"tm_graticules( x = NA, y = NA, n.x = NA, n.y = NA, crs = 4326, labels.format = list(suffix = intToUtf8(176)), labels.cardinal = TRUE, ... ) tm_grid( x = NA, y = NA, n.x = NA, n.y = NA, crs = NA, col = NA, lwd = 1, alpha = NA, labels.show = TRUE, labels.pos = c(\"left\", \"bottom\"), labels.size = 0.6, labels.col = NA, labels.rot = c(0, 0), labels.format = list(big.mark = \",\"), labels.cardinal = FALSE, labels.margin.x = 0, labels.margin.y = 0, labels.space.x = NA, labels.space.y = NA, labels.inside.frame = FALSE, ticks = labels.show & !labels.inside.frame, lines = TRUE, ndiscr = 100, zindex = NA, group = NA, group.control = \"none\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coordinate grid / graticule lines — tm_graticules","text":"x X coordinates vertical grid lines. NA, specified pretty scale n.x. y Y coordinates horizontal grid lines. NA, specified pretty scale n.y. n.x Preferred number grid lines x axis. labels, pretty() sequence used, number actual labels may different n.x. n.y Preferred number grid lines y axis. labels, pretty() sequence used, number actual labels may different n.y. crs Projection character. specified, grid lines projected accordingly. Many world maps projected, still latitude longitude (EPSG 4326) grid lines. labels.format List formatting options grid labels. Parameters : fun Function specify labels. take numeric vector, return character vector size. default specified. specified, list items scientific, format, digits (see ) used. scientific labels formatted scientifically? , square brackets used, format numbers \"g\". Otherwise, format=\"f\", text.separator, text.less., text..used. Also, numbers automatically rounded millions billions applicable. format default, \"f\", .e. standard notation xxx.xxx, used. scientific=TRUE \"g\", means numbers formatted scientifically, .e. n.dddE+nn needed save space. digits Number digits decimal point format=\"f\", number significant digits otherwise. ... arguments passed formatC() labels.cardinal Add four cardinal directions (N, E, S, W) labels, instead using negative coordinates west south (assumes coordinates positive north-east direction). ... Arguments passed tm_grid() col Color grid lines. lwd Line width grid lines alpha Alpha transparency grid lines. Number 0 1. default, alpha transparency col taken. labels.show Show tick labels. Either one value x y axis, vector two: first x latter y. labels.pos position labels. Vector two: horizontal (\"left\" \"right\") vertical (\"top\" \"bottom\") position. labels.size Font size tick labels labels.col Font color tick labels labels.rot Rotation angles labels. Vector two values: first rotation angle (degrees) tick labels x axis second rotation angle tick labels y axis. 0, 90, 180, 270 valid values. labels.margin.x Margin tick labels x axis frame. Note labels.inside.frame == FALSE ticks == TRUE, ticks adjusted accordingly. labels.margin.y Margin tick labels y axis frame. Note labels.inside.frame == FALSE ticks == TRUE, ticks adjusted accordingly. labels.space.x Space used labels ticks x-axis labels.inside.frame == FALSE. default, determined automatically using widths heights tick labels. unit parameter text line height. labels.space.y Space used labels ticks y-axis labels.inside.frame == FALSE. default, determined automatically using widths heights tick labels. unit parameter text line height. labels.inside.frame Show labels inside frame? default FALSE ticks labels.inside.frame = FALSE, ticks can drawn labels frame? Either one value x y axis, vector two: first x latter y. lines labels.inside.frame = FALSE, grid lines can drawn? ndiscr Number points discretize parallel meridian (applicable curved grid lines) zindex zindex pane view mode. default, set layer number plus 400. default, tmap layers therefore placed custom panes \"tmap401\", \"tmap402\", etc., except base tile layers, placed standard \"tile\". parameter determines name pane z-index, determines pane order bottom top. instance, zindex set 500, pane named \"tmap500\". group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coordinate grid / graticule lines — tm_graticules","text":"","code":"current.mode <- tmap_mode(\"plot\") #> tmap mode set to 'plot' tm_shape(NLD_muni) + tm_polygons() + tm_grid() tm_shape(NLD_muni) + tm_polygons() + tm_grid(crs = 4326) tm_shape(NLD_muni) + tm_polygons() + tm_grid(crs = 3035, labels.inside.frame = TRUE) tm_shape(World) + tm_polygons() + tm_facets(by = \"continent\") + tm_grid(labels.inside.frame = TRUE) tm_shape(NLD_muni) + tm_polygons() + tm_graticules() tm_shape(NLD_muni) + tm_polygons() + tm_graticules(labels.pos = c(\"right\", \"top\")) data(NLD_muni, World) tmap_arrange( qtm(NLD_muni, borders = NULL) + tm_grid(), qtm(NLD_muni, borders = NULL) + tm_graticules() ) qtm(World, shape.crs = \"+proj=robin\", style = \"natural\") + tm_graticules(ticks = FALSE) + tm_layout(frame=FALSE) tmap_mode(current.mode) #> tmap mode set to 'plot'"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":null,"dir":"Reference","previous_headings":"","what":"Layout options — tm_layout","title":"Layout options — tm_layout","text":"Set tmap options directly related layout.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Layout options — tm_layout","text":"","code":"tm_layout( modes, crs, facet.max, facet.flip, raster.max.cells, show.messages, show.warnings, output.format, output.size, output.dpi, output.dpi.animation, value.const, value.na, value.null, value.blank, values.var, values.range, value.neutral, scales.var, scale.misc.args, label.format, label.na, scale, asp, bg.color, outer.bg.color, frame, frame.lwd, frame.r, frame.double.line, outer.margins, inner.margins, inner.margins.extra, meta.margins, meta.auto.margins, between.margin, component.offset, component.stack.margin, grid.mark.height, xylab.height, coords.height, xlab.show, xlab.text, xlab.size, xlab.color, xlab.rotation, xlab.space, xlab.fontface, xlab.fontfamily, xlab.side, ylab.show, ylab.text, ylab.size, ylab.color, ylab.rotation, ylab.space, ylab.fontface, ylab.fontfamily, ylab.side, panel.type, panel.wrap.pos, panel.xtab.pos, unit, color.sepia.intensity, color.saturation, color.vision.deficiency.sim, text.fontface, text.fontfamily, legend.show, legend.design, legend.orientation, legend.position, legend.width, legend.height, legend.stack, legend.group.frame, legend.resize.as.group, legend.reverse, legend.na.show, legend.title.color, legend.title.size, legend.title.fontface, legend.title.fontfamily, legend.xlab.color, legend.xlab.size, legend.xlab.fontface, legend.xlab.fontfamily, legend.ylab.color, legend.ylab.size, legend.ylab.fontface, legend.ylab.fontfamily, legend.text.color, legend.text.size, legend.text.fontface, legend.text.fontfamily, legend.frame, legend.frame.lwd, legend.frame.r, legend.bg.color, legend.bg.alpha, legend.settings.standard.portrait, legend.settings.standard.landscape, title.show, title.size, title.color, title.fontface, title.fontfamily, title.bg.color, title.bg.alpha, title.padding, title.frame, title.frame.lwd, title.frame.r, title.stack, title.position, title.group.frame, title.resize.as.group, credits.show, credits.size, credits.color, credits.fontface, credits.fontfamily, credits.bg.color, credits.bg.alpha, credits.padding, credits.frame, credits.frame.lwd, credits.frame.r, credits.stack, credits.position, credits.width, credits.heigth, credits.group.frame, credits.resize.as.group, compass.north, compass.type, compass.text.size, compass.size, compass.show.labels, compass.cardinal.directions, compass.text.color, compass.color.dark, compass.color.light, compass.lwd, compass.bg.color, compass.bg.alpha, compass.margins, compass.show, compass.stack, compass.position, compass.frame, compass.frame.lwd, compass.frame.r, compass.group.frame, compass.resize.as.group, scalebar.show, scalebar.breaks, scalebar.width, scalebar.text.size, scalebar.text.color, scalebar.color.dark, scalebar.color.light, scalebar.lwd, scalebar.position, scalebar.bg.color, scalebar.bg.alpha, scalebar.size, scalebar.margins, scalebar.stack, scalebar.frame, scalebar.frame.lwd, scalebar.frame.r, scalebar.group.frame, scalebar.resize.as.group, grid.show, grid.labels.pos, grid.x, grid.y, grid.n.x, grid.n.y, grid.crs, grid.col, grid.lwd, grid.alpha, grid.labels.show, grid.labels.size, grid.labels.col, grid.labels.rot, grid.labels.format, grid.labels.cardinal, grid.labels.margin.x, grid.labels.margin.y, grid.labels.space.x, grid.labels.space.y, grid.labels.inside.frame, grid.ticks, grid.lines, grid.ndiscr, mouse_coordinates.stack, mouse_coordinates.position, mouse_coordinates.show, panel.show, panel.labels, panel.label.size, panel.label.color, panel.label.fontface, panel.label.fontfamily, panel.label.bg.color, panel.label.height, panel.label.rot, qtm.scalebar, qtm.minimap, qtm.mouse.coordinates, earth.boundary, earth.boundary.color, earth.boundary.lwd, earth.datum, space.color, attr.color, max.categories, legend.hist.bg.color, legend.hist.bg.alpha, legend.hist.size, legend.hist.height, legend.hist.width, attr.outside, attr.outside.position, attr.outside.size, attr.position, attr.just, basemap.server, basemap.alpha, basemap.zoom, overlays, overlays.alpha, alpha, colorNA, symbol.size.fixed, dot.size.fixed, text.size.variable, bbox, check.and.fix, set.bounds, set.view, set.zoom.limits, name, basemap.show, title = NULL, main.title = NULL, ... ) tm_style(style, ...) tm_format(format, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Layout options — tm_layout","text":"modes, crs, facet.max, facet.flip, raster.max.cells, show.messages, show.warnings, output.format, output.size, output.dpi, output.dpi.animation, value.const, value.na, value.null, value.blank, values.var, values.range, value.neutral, scales.var, scale.misc.args, label.format, label.na, scale, asp, bg.color, outer.bg.color, frame, frame.lwd, frame.r, frame.double.line, outer.margins, inner.margins, inner.margins.extra, meta.margins, meta.auto.margins, .margin, component.offset, component.stack.margin, grid.mark.height, xylab.height, coords.height, xlab.show, xlab.text, xlab.size, xlab.color, xlab.rotation, xlab.space, xlab.fontface, xlab.fontfamily, xlab.side, ylab.show, ylab.text, ylab.size, ylab.color, ylab.rotation, ylab.space, ylab.fontface, ylab.fontfamily, ylab.side, panel.type, panel.wrap.pos, panel.xtab.pos, unit, color.sepia.intensity, color.saturation, color.vision.deficiency.sim, text.fontface, text.fontfamily, legend.show, legend.design, legend.orientation, legend.position, legend.width, legend.height, legend.stack, legend.group.frame, legend.resize..group, legend.reverse, legend.na.show, legend.title.color, legend.title.size, legend.title.fontface, legend.title.fontfamily, legend.xlab.color, legend.xlab.size, legend.xlab.fontface, legend.xlab.fontfamily, legend.ylab.color, legend.ylab.size, legend.ylab.fontface, legend.ylab.fontfamily, legend.text.color, legend.text.size, legend.text.fontface, legend.text.fontfamily, legend.frame, legend.frame.lwd, legend.frame.r, legend.bg.color, legend.bg.alpha, legend.settings.standard.portrait, legend.settings.standard.landscape, title.show, title.size, title.color, title.fontface, title.fontfamily, title.bg.color, title.bg.alpha, title.padding, title.frame, title.frame.lwd, title.frame.r, title.stack, title.position, title.group.frame, title.resize..group, credits.show, credits.size, credits.color, credits.fontface, credits.fontfamily, credits.bg.color, credits.bg.alpha, credits.padding, credits.frame, credits.frame.lwd, credits.frame.r, credits.stack, credits.position, credits.width, credits.heigth, credits.group.frame, credits.resize..group, compass.north, compass.type, compass.text.size, compass.size, compass.show.labels, compass.cardinal.directions, compass.text.color, compass.color.dark, compass.color.light, compass.lwd, compass.bg.color, compass.bg.alpha, compass.margins, compass.show, compass.stack, compass.position, compass.frame, compass.frame.lwd, compass.frame.r, compass.group.frame, compass.resize..group, scalebar.show, scalebar.breaks, scalebar.width, scalebar.text.size, scalebar.text.color, scalebar.color.dark, scalebar.color.light, scalebar.lwd, scalebar.position, scalebar.bg.color, scalebar.bg.alpha, scalebar.size, scalebar.margins, scalebar.stack, scalebar.frame, scalebar.frame.lwd, scalebar.frame.r, scalebar.group.frame, scalebar.resize..group, grid.show, grid.labels.pos, grid.x, grid.y, grid.n.x, grid.n.y, grid.crs, grid.col, grid.lwd, grid.alpha, grid.labels.show, grid.labels.size, grid.labels.col, grid.labels.rot, grid.labels.format, grid.labels.cardinal, grid.labels.margin.x, grid.labels.margin.y, grid.labels.space.x, grid.labels.space.y, grid.labels.inside.frame, grid.ticks, grid.lines, grid.ndiscr, mouse_coordinates.stack, mouse_coordinates.position, mouse_coordinates.show, panel.show, panel.labels, panel.label.size, panel.label.color, panel.label.fontface, panel.label.fontfamily, panel.label.bg.color, panel.label.height, panel.label.rot, qtm.scalebar, qtm.minimap, qtm.mouse.coordinates, earth.boundary, earth.boundary.color, earth.boundary.lwd, earth.datum, space.color, attr.color, max.categories, legend.hist.bg.color, legend.hist.bg.alpha, legend.hist.size, legend.hist.height, legend.hist.width, attr.outside, attr.outside.position, attr.outside.size, attr.position, attr.just, basemap.server, basemap.alpha, basemap.zoom, overlays, overlays.alpha, alpha, colorNA, symbol.size.fixed, dot.size.fixed, text.size.variable, bbox, check..fix, set.bounds, set.view, set.zoom.limits, name, basemap.show seetmap_options() title, main.title deprecated ... used catch deprecated arguments style name style format name format","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Layout options — tm_layout","text":"","code":"data(land, World) # Error unable to warp stars (argument not yet added to tm_shape) # On Windows if (FALSE) { tm_shape(land, raster.wrap = FALSE) + tm_raster( \"elevation\", col.scale = tm_scale_intervals( breaks = c(-Inf, 250, 500, 1000, 1500, 2000, 2500, 3000, 4000, Inf), values = terrain.colors(9), midpoint = NA ), col.legend = tm_legend( title = \"Elevation\", position = tm_pos_in(\"left\", \"bottom\"), frame = TRUE, bg.color = \"lightblue\" ) ) + tm_shape(World, is.main = TRUE, crs = \"+proj=eck4\") + tm_borders(\"grey20\") + tm_graticules(labels.size = .5) + tm_text(\"name\", size = \"AREA\") + # tm_compass(position = c(.65, .15), color.light = \"grey90\") + # tm_credits(\"Eckert IV projection\", position = c(\"right\", \"BOTTOM\")) + tm_style(\"classic_v3\") + tm_layout(bg.color = \"lightblue\", inner.margins = c(0, 0, .02, 0)) } data(land, World) tm_shape(World) + tm_fill(\"pop_est_dens\", fill.scale = tm_scale_intervals(style = \"kmeans\"), fill.legend = tm_legend(title = \"Population density\")) + tm_style(\"albatross_v3\", frame.lwd = 10) + tm_format(\"World\") + tm_title(\"The World\", position = tm_pos_in(\"left\", \"top\")) ################################ # not working yet: ################################ if (FALSE) { tm_shape(land) + tm_raster(\"elevation\", breaks=c(-Inf, 250, 500, 1000, 1500, 2000, 2500, 3000, 4000, Inf), palette = terrain.colors(9), title=\"Elevation\", midpoint = NA) + tm_shape(World, is.master=TRUE, projection = \"+proj=eck4\") + tm_borders(\"grey20\") + tm_graticules(labels.size = .5) + tm_text(\"name\", size=\"AREA\") + tm_compass(position = c(.65, .15), color.light = \"grey90\") + tm_credits(\"Eckert IV projection\", position = c(\"right\", \"BOTTOM\")) + tm_style(\"classic\") + tm_layout(bg.color=\"lightblue\", inner.margins=c(.04,.03, .02, .01), earth.boundary = TRUE, space.color=\"grey90\") + tm_legend(position = c(\"left\", \"bottom\"), frame = TRUE, bg.color=\"lightblue\") } tm_shape(World, projection=\"+proj=robin\") + tm_polygons(\"HPI\", palette=\"div\", n=7, title = \"Happy Planet Index\") + tm_credits(\"Robinson projection\", position = c(\"right\", \"BOTTOM\")) + tm_style(\"natural\", earth.boundary = c(-180, -87, 180, 87), inner.margins = .05) + tm_legend(position=c(\"left\", \"bottom\"), bg.color=\"grey95\", frame=TRUE) #> Warning: The 'projection' argument of 'tm_shape()' is deprecated as of tmap 4.0. Pleaes use 'crs' instead. #> Deprecated tmap v3 code detected. Code translated to v4 #> Warning: v3 code detected: as of tmap v4, tm_legend should be specified per visual variable (e.g. with the argument fill.legend of tm_polygons # Not working yet if (FALSE) { # Example to illustrate the type of titles tm_shape(World) + tm_polygons(c(\"income_grp\", \"economy\"), title = c(\"Legend Title 1\", \"Legend Title 2\")) + tm_layout(main.title = \"Main Title\", main.title.position = \"center\", main.title.color = \"blue\", title = c(\"Title 1\", \"Title 2\"), title.color = \"red\", panel.labels = c(\"Panel Label 1\", \"Panel Label 2\"), panel.label.color = \"purple\", legend.text.color = \"brown\") } if (FALSE) { # global option tmap.style demo # get current style current.style <- tmap_style() qtm(World, fill = \"economy\", format = \"World\") tmap_style(\"col_blind\") qtm(World, fill = \"economy\", format = \"World\") tmap_style(\"cobalt\") qtm(World, fill = \"economy\", format = \"World\") # set to current style tmap_style(current.style) } # TIP: check out these examples in view mode, enabled with tmap_mode(\"view\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Legend — tm_legend","title":"Legend — tm_legend","text":"Legend specification","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Legend — tm_legend","text":"","code":"tm_legend( title, show, orientation, design, reverse, na.show, position, width, height, stack, z, group.frame, resize.as.group, title.color, title.size, title.fontface, title.fontfamily, title.padding, text.color, text.size, text.fontface, text.fontfamily, format, frame, frame.lwd, frame.r, bg.color, bg.alpha, item.height, item.width, item.space, item.na.height, item.na.width, item.na.space, item.shape, ticks, ticks.disable.na, ticks.col, ticks.lwd, title.align, margins, margin.item.text, ... ) tm_legend_hide() tm_legend_combine(variable)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Legend — tm_legend","text":"title PARAM_DESCRIPTION show PARAM_DESCRIPTION orientation PARAM_DESCRIPTION design PARAM_DESCRIPTION reverse PARAM_DESCRIPTION na.show PARAM_DESCRIPTION position PARAM_DESCRIPTION width PARAM_DESCRIPTION height PARAM_DESCRIPTION stack PARAM_DESCRIPTION z PARAM_DESCRIPTION group.frame PARAM_DESCRIPTION resize..group PARAM_DESCRIPTION title.color PARAM_DESCRIPTION title.size PARAM_DESCRIPTION title.fontface PARAM_DESCRIPTION title.fontfamily PARAM_DESCRIPTION title.padding PARAM_DESCRIPTION text.color PARAM_DESCRIPTION text.size PARAM_DESCRIPTION text.fontface PARAM_DESCRIPTION text.fontfamily PARAM_DESCRIPTION format PARAM_DESCRIPTION frame PARAM_DESCRIPTION frame.lwd PARAM_DESCRIPTION frame.r PARAM_DESCRIPTION bg.color PARAM_DESCRIPTION bg.alpha PARAM_DESCRIPTION item.height PARAM_DESCRIPTION item.width PARAM_DESCRIPTION item.space PARAM_DESCRIPTION item.na.height PARAM_DESCRIPTION item.na.width PARAM_DESCRIPTION item.na.space PARAM_DESCRIPTION item.shape PARAM_DESCRIPTION ticks PARAM_DESCRIPTION ticks.disable.na PARAM_DESCRIPTION ticks.col PARAM_DESCRIPTION ticks.lwd PARAM_DESCRIPTION title.align PARAM_DESCRIPTION margins PARAM_DESCRIPTION margin.item.text PARAM_DESCRIPTION ... passed (?) variable visual (transformation) variable combine legend : e.g. \"fill\" \"size\"","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Legend — tm_legend","text":"OUTPUT_DESCRIPTION","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: lines — tm_lines","title":"Map layer: lines — tm_lines","text":"Map layer draws symbols Supported visual variables : col (color), lwd (line width), lty (line type), col_alpha (color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: lines — tm_lines","text":"","code":"tm_lines( col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, linejoin = \"round\", lineend = \"round\", plot.order = tm_plot_order(\"LENGTH\", reverse = FALSE, na.order = \"bottom\"), trans.args = list(lines.only = \"ifany\"), mapping.args = list(), zindex = NA, group = NA, group.control = \"check\", popup.vars = NA, popup.format = list(), hover = \"\", id = \"\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: lines — tm_lines","text":"col, col.scale, col.legend, col.free Visual variable determines col color. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin, lineend line join line end. See gpar() details. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.col) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode. ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: lines — tm_lines","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: lines — tm_lines","text":"","code":"data(rivers) tm_shape(rivers) + tm_lines() tm_shape(rivers) + tm_lines(lwd = \"scalerank\") tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lwd.scale = tm_scale_continuous(values.scale = 2, n = 20), lwd.legend = tm_legend(orientation = \"landscape\", item.width = 2), col = \"type\", col.scale = tm_scale(values = c(\"darkblue\", \"darkred\"))) tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lty = \"scalerank\", col = \"scalerank\", col.scale = tm_scale_categorical(), lty.legend = tm_legend_combine(\"lwd\"), col.legend = tm_legend_combine(\"lwd\")) ### tmap3 tm_shape(World) + tm_fill() + tm_shape(rivers) + tm_lines(col=\"black\", lwd=\"scalerank\", scale=2, legend.lwd.show = FALSE) + tm_style(\"cobalt\", title = \"Rivers of the World\") + tm_format(\"World\") #> Deprecated tmap v3 code detected. Code translated to v4"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mouse_coordinates.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: mouse coordinates — tm_mouse_coordinates","title":"Map component: mouse coordinates — tm_mouse_coordinates","text":"Map component adds mouse coordinates","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mouse_coordinates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: mouse coordinates — tm_mouse_coordinates","text":"","code":"tm_mouse_coordinates(stack, position, z)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mouse_coordinates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: mouse coordinates — tm_mouse_coordinates","text":"stack stack position position z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv.html","id":null,"dir":"Reference","previous_headings":"","what":"define multivariate variable — tm_mv","title":"define multivariate variable — tm_mv","text":"define multivariate variable","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"define multivariate variable — tm_mv","text":"","code":"tm_mv(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"define multivariate variable — tm_mv","text":"... variable names","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv_dim.html","id":null,"dir":"Reference","previous_headings":"","what":"define multivariate variable based on stars dimension — tm_mv_dim","title":"define multivariate variable based on stars dimension — tm_mv_dim","text":"define multivariate variable based stars dimension","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv_dim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"define multivariate variable based on stars dimension — tm_mv_dim","text":"","code":"tm_mv_dim(x, values)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv_dim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"define multivariate variable based on stars dimension — tm_mv_dim","text":"x dimension name values values used","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot mode options — tm_plot","title":"Plot mode options — tm_plot","text":"Plot mode options. option specific plot mode.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot mode options — tm_plot","text":"","code":"tm_plot(use.gradient)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot mode options — tm_plot","text":"use.gradient Use gradient fill using linearGradient()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot_order.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine plotting order of features — tm_plot_order","title":"Determine plotting order of features — tm_plot_order","text":"Determine plotting order features.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot_order.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine plotting order of features — tm_plot_order","text":"","code":"tm_plot_order( aes, reverse = TRUE, na.order = c(\"mix\", \"bottom\", \"top\"), null.order = c(\"bottom\", \"mix\", \"top\"), null.below.na = TRUE )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot_order.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine plotting order of features — tm_plot_order","text":"aes Visual variable values determine plotting order. Example: bubble map \"size\" aesthetic used. data variable (say population) mapped via continuous scale (tm_scale_continuous()) bubble sizes. bubbles plotted order size. determined arguments. Use \"DATA\" keep order data. Another special value \"AREA\" \"LENGTH\" preserved polygons lines respectively: rather data variable polygon area / line lengths determines plotting order. reverse Logical determines whether visual values plotted reversed order. visual values (specified tmap option \"values.var\") default reversed, plotted starting last value. bubble map example, means large bubbles plotted first, hence bottom. na.order features plotted NA value (least) one aesthetic variable? (order) \"mix\", \"bottom\", \"top\"? bubble map example: fill color missing bubble, bubbles plotted? null.order non-selected (aka null) features plotted? null..na null features plotted NA features?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: polygons — tm_polygons","title":"Map layer: polygons — tm_polygons","text":"Map layer draws polygons. Supported visual variables : fill (fill color), col (border color), lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) col_alpha (border color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: polygons — tm_polygons","text":"","code":"tm_polygons( fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, linejoin = \"round\", lineend = \"round\", plot.order = tm_plot_order(\"AREA\", reverse = FALSE, na.order = \"bottom\"), trans.args = list(polygons.only = \"ifany\"), mapping.args = list(), zindex = NA, group = NA, group.control = \"check\", popup.vars = NA, popup.format = list(), hover = \"\", id = \"\", ... ) tm_fill(...) tm_borders(col = tm_const(), ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: polygons — tm_polygons","text":"fill, fill.scale, fill.legend, fill.free Visual variable determines fill color. See details. col, col.scale, col.legend, col.free Visual variable determines border color. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin, lineend Line join line end. See gpar() details. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.col) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode. ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: polygons — tm_polygons","text":"visual variable arguments (e.g. col) can specified either data variable name (e.g., spatial vector attribute raster layer object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default specified tmap option (tm_options()) scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options (tm_options()) legend. . .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: polygons — tm_polygons","text":"","code":"# load Africa country data data(World) Africa = World[World$continent == \"Africa\", ] Africa_border = sf::st_make_valid(sf::st_union(sf::st_buffer(Africa, 0.001))) # slow and ugly # without specifications tm_shape(Africa_border) + tm_polygons() tm_shape(Africa_border) + tm_fill() tm_shape(Africa_border) + tm_borders() # specification with visual variable values tm_shape(Africa) + tm_polygons(fill = \"limegreen\", col = \"purple\", lwd = 3, lty = \"solid\", col_alpha = 0.3) + tm_shape(Africa_border) + tm_borders(\"darkred\", lwd = 4) # specification with a data variable tm_shape(Africa) + tm_polygons(fill = \"income_grp\", fill.scale = tm_scale_categorical(values = \"tol.muted\")) # continuous color scale with landscape legend tm_shape(Africa) + tm_polygons(fill = \"inequality\", fill.scale = tm_scale_continuous(values = \"kovesi.rainbow_bu_pk\"), fill.legend = tm_legend( title = \"\", orientation = \"landscape\", position = tm_pos_out(\"center\", \"bottom\"), frame = FALSE )) + tm_title(\"Inequality index\", position = tm_pos_in(\"right\", \"TOP\"), frame = FALSE) + tm_layout(frame = FALSE) #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). tm_shape(World) + tm_polygons(tm_mv(\"inequality\", \"well_being\")) #> Labels abbreviated by the first letters, e.g.: \"2 to 3\" => \"2\" #################################### ########## v3 ###################### #################################### tmap_style(\"v3\") #> tmap style set to \"v3\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" data(World) # Constant fill tm_shape(World) + tm_fill(\"darkolivegreen3\") + tm_format(\"World\", title=\"A green World\") #> Warning: The 'title' argument of 'tm_format()' is deprecated as of tmap 4.0. Please use 'tm_title()' instead. # Borders only tm_shape(World) + tm_borders() # Data variable containing color values World$isNLD = ifelse(World$name==\"Netherlands\", \"darkorange\", \"darkolivegreen3\") tm_shape(World) + tm_fill(\"isNLD\") + tm_layout(\"Find the Netherlands!\") tm_shape(World, projection = \"+proj=eck4\") + tm_polygons(\"economy\", title=\"Economy\", id=\"name\") + tm_text(\"iso_a3\", size=\"AREA\", scale=1.5) + tm_format(\"World\") #> Warning: The 'projection' argument of 'tm_shape()' is deprecated as of tmap 4.0. Pleaes use 'crs' instead. #> Deprecated tmap v3 code detected. Code translated to v4 #> Deprecated tmap v3 code detected. Code translated to v4 # Numeric data variable tm_shape(World, projection = \"+proj=eck4\") + tm_polygons(\"HPI\", palette=\"RdYlGn\", style=\"cont\", n=8, title=\"Happy Planet Index\", id=\"name\") + tm_text(\"iso_a3\", size=\"AREA\", scale=1.5) + tm_style(\"grey\") + tm_format(\"World\") #> Warning: The 'projection' argument of 'tm_shape()' is deprecated as of tmap 4.0. Pleaes use 'crs' instead. #> Deprecated tmap v3 code detected. Code translated to v4 #> Deprecated tmap v3 code detected. Code translated to v4 if (FALSE) { data(NLD_prov, NLD_muni) # Map coloring algorithm tm_shape(NLD_prov) + tm_fill(\"name\", legend.show = FALSE) + tm_shape(NLD_muni) + tm_polygons(\"MAP_COLORS\", palette=\"Greys\", alpha = .25) + tm_shape(NLD_prov) + tm_borders(lwd=2) + tm_text(I(\"name\"), col = \"white\", shadow=TRUE) + tm_format(\"NLD\", title=\"Dutch provinces and\\nmunicipalities\", bg.color=\"white\") # Cartogram if (require(cartogram)) { NLD_prov_pop <- cartogram(NLD_prov, \"population\") tm_shape(NLD_prov_pop) + tm_polygons(\"origin_non_west\", title = \"Non-western origin (%)\") } } # TIP: check out these examples in view mode, enabled with tmap_mode(\"view\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the position of map components — tm_pos","title":"Set the position of map components — tm_pos","text":"Set position map components, legends, title, compass, scale bar, etc. tm_pos() function position components: tm_pos_out() places components outside map area tm_pos_in() inside map area. position argument map layer component specified one functions. functions tm_pos_auto_out() tm_pos_auto_in() used set components automatically, recommended use globally, via tmap_options(). See Details positioning works.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the position of map components — tm_pos","text":"","code":"tm_pos(cell.h, cell.v, pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_in(pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_out(cell.h, cell.v, pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_auto_out(cell.h, cell.v, pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_auto_in(align.h, align.v, just.h, just.v)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the position of map components — tm_pos","text":"cell.h, cell.v plotting area overlaid 3x3 grid, middle grid cell map area. Components can drawn cell. cell.h specifies horizontal position (column) can take values \"left\", \"center\", \"right\", cell.v specifies vertical position (row) can take values \"top\", \"center\", \"bottom\". See details graphical explanation. pos.h, pos.v position component within cell. main options pos.h \"left\", \"center\", \"right\", cell.v \"top\", \"center\", \"bottom\". options can also provided upper case; case offset (see tmap option component.offset). Also numbers 0 1 can provided, determine position component inside cell ((0,0) left bottom). arguments just.h just.v determine justification point. align.h, align.v alignment component case multiple components stacked. stacked horizontally, align.v determines components smaller height available height (determined outer.margins specified otherwise highest component) justified: \"top\", \"center\", \"bottom\". Similarly, align.h determines components justified horizontally stacked vertically: \"left\", \"center\", \"right\". just.h, just.v justification components. used case pos.h pos.v numbers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set the position of map components — tm_pos","text":"tm_pos_in() sets position component(s) inside maps area, equivalent center-center cell (case facets, drawn center-center cell). tm_pos_out() sets position component(s) outside map. amount space top bottom rows, left right columns occupy determined tm_layout() arguments meta.margins meta.auto.margins. former sets relative space bottom, left, top, right side. case set NA, space set automatically based 1) maximum relative space specified meta.auto.margins 2) presence size components cell. instance, one landscape oriented legend center-bottom cell, relative space bottom row set height legend (given smaller corresponding value meta.auto.margins), four sides set 0. tm_pos_auto_out() complex: cell.h cell.v arguments set one four corners. mean components drawn corner. corner represents sides map components drawn. default, legends drawn either bottom right-side map default (see tmap_options(\"legend.position\")). row- column-wise legends general legend (using tm_facets_grid()), general legend drawn corner, practice case rare. arguments pos.h pos.v determine components drawn within cell. , \"left\", \"center\", \"right\" pos.h \"top\", \"center\", \"bottom\" pos.v. values can also specified upper-case, influences offset cell borders, determined tmap option component.offset. default, small offset components drawn inside offset drawn outside upper-case. tm_pos_auto_in() automatically determines pos.h pos.v given available space inside map. similar default positioning tmap3. case multiple components draw cell position inside cell, stacked (determined stack argument legend component function). align.h align.v arguments determine components justified . Note legends components may different facet row column. case tm_facets_grid() tm_facets_stack() applied scales set free (.free argument map layer functions). case legends components draw row- column wise, position legends (components) right next maps, legends (components) aligned maps.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: raster — tm_raster","title":"Map layer: raster — tm_raster","text":"Map layer draws rasters. Supported visual variable : col ( color).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: raster — tm_raster","text":"","code":"tm_raster( col = tm_shape_vars(), col.scale = tm_scale(value.na = \"#00000000\"), col.legend = tm_legend(), col.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, trans.args = list(), mapping.args = list(), zindex = NA, group = NA, group.control = \"check\" )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: raster — tm_raster","text":"col, col.scale, col.legend, col.free Visual variable determines color. See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines alpha transparency. See details. trans.args, mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: raster — tm_raster","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: raster — tm_raster","text":"","code":"# load land data data(land, World) tm_shape(land) + tm_raster() + tm_facets_hstack() #> stars object downsampled to 540 by 270 cells. #> Variable(s) \"col\" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette. #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). tm_shape(land) + tm_raster(\"elevation\", col.scale = tm_scale_continuous(values = terrain.colors(9))) + tm_shape(World) + tm_borders()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_rgb.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: RGB — tm_rgb","title":"Map layer: RGB — tm_rgb","text":"Map layer: RGB","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_rgb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: RGB — tm_rgb","text":"","code":"tm_rgb( col = tm_mv(1:3), col.scale = tm_scale_rgb(), col.legend = tm_legend(), col.free = NA )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_rgb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: RGB — tm_rgb","text":"col, col.scale, col.legend, col.free Visual variable determines col color.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: automatic scale — tm_scale","title":"Scales: automatic scale — tm_scale","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale() scale set automatically given data type (factor, numeric, integer) visual variable. tmap option scales.var contains information scale applied .","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: automatic scale — tm_scale","text":"","code":"tm_scale(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: automatic scale — tm_scale","text":"... arguments passed applied scale function tm_scale_*()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bar.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: scale bar — tm_scale_bar","title":"Map component: scale bar — tm_scale_bar","text":"function renamed tm_scalebar() tmap v4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: scale bar — tm_scale_bar","text":"","code":"tm_scale_bar(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: scale bar — tm_scale_bar","text":"... Arguments passed tm_scalebar breaks breaks width width text.size text.size text.color text.color color.dark color.dark color.light color.light lwd lwd position position bg.color bg.color bg.alpha bg.alpha size size stack stack frame frame frame.lwd frame.lwd frame.r frame.r margins margins z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bivariate.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: bivariate scale — tm_scale_bivariate","title":"Scales: bivariate scale — tm_scale_bivariate","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_bivariate() used bivariate.scales.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bivariate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: bivariate scale — tm_scale_bivariate","text":"","code":"tm_scale_bivariate( scale1 = tm_scale(), scale2 = tm_scale(), values = NA, values.repeat = FALSE, values.range = NA, values.scale = 1, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bivariate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: bivariate scale — tm_scale_bivariate","text":"scale1, scale2 two tm_scale objects. Currently, tm_scale_ functions supported except tm_scale_continous(). values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols()) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, grey scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark grey light grey used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle grey (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_categorical.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: categorical and ordinal scale — tm_scale_ordinal","title":"Scales: categorical and ordinal scale — tm_scale_ordinal","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). functions tm_scale_categorical() tm_scale_ordinal() used categorical data. difference functions former assumes unordered categories whereas latter assumes ordered categories. colors (visual variable fill col), different default color palettes used (see tmap option values.var).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_categorical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: categorical and ordinal scale — tm_scale_ordinal","text":"","code":"tm_scale_ordinal( n.max = 30, values = NA, values.repeat = FALSE, values.range = 1, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, levels = NULL, levels.drop = FALSE, labels = NULL, label.na = NA, label.null = NA, label.format = list() ) tm_scale_categorical( n.max = 30, values = NA, values.repeat = TRUE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, levels = NULL, levels.drop = FALSE, labels = NULL, label.na = NA, label.null = NA, label.format = list() )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_categorical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: categorical and ordinal scale — tm_scale_ordinal","text":"n.max Maximum number categories (factor levels). case , grouped n.max groups. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols()) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle gray (\"gray50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. levels Levels show. values treated missing. levels.drop unused levels dropped (therefore assigned visual value shown legend)? labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_continuous.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: continuous scale — tm_scale_continuous","title":"Scales: continuous scale — tm_scale_continuous","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_continuous used continuous data. functions tm_scale_continuous_ use transformation functions x.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_continuous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: continuous scale — tm_scale_continuous","text":"","code":"tm_scale_continuous( n = NULL, limits = NULL, outliers.trunc = NULL, ticks = NULL, trans = NULL, midpoint = NULL, values = NA, values.repeat = FALSE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA, label.format = list() ) tm_scale_continuous_log(...) tm_scale_continuous_log1p(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_continuous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: continuous scale — tm_scale_continuous","text":"n Preferred number tick labels. used ticks specified limits Limits data values mapped continuous scale outliers.trunc outliers truncated? outlier data value respectively lower upper limit. logical vector two values expected. first second value determines whether values lower lower limit respectively higher upper limit truncated lower respectively upper limit. FALSE (default), considered missing values. ticks Tick values. specified, determined automatically n trans Transformation function. One \"identity\" (default), \"log\", \"log1p\". Note: base log scale irrelevant, since log transformed values normalized mapping visual values. midpoint data value interpreted midpoint. default set 0 negative positive values present. Useful values diverging colors. case, two sides color palette assigned negative respectively positive values. values positive values negative, midpoint set NA, means value corresponds middle color class (see style) mapped middle color. specified sequential color palettes (e.g. \"Blues\"), color palette treated diverging color palette. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols()) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values, especially useful color palettes. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle gray (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3) ... passed tm_scale_continuous","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_discrete.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: discrete scale — tm_scale_discrete","title":"Scales: discrete scale — tm_scale_discrete","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_discrete() used discrete numerical data, integers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_discrete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: discrete scale — tm_scale_discrete","text":"","code":"tm_scale_discrete( ticks = NA, midpoint = NULL, values = NA, values.repeat = FALSE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA, label.format = list() )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_discrete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: discrete scale — tm_scale_discrete","text":"ticks Discrete values. specified, determined automatically: unique values put discrete scale. midpoint data value interpreted midpoint. default set 0 negative positive values present. Useful values diverging colors. case, two sides color palette assigned negative respectively positive values. values positive values negative, midpoint set NA, means value corresponds middle color class (see style) mapped middle color. specified sequential color palettes (e.g. \"Blues\"), color palette treated diverging color palette. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle grey (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_intervals.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: interval scale — tm_scale_intervals","title":"Scales: interval scale — tm_scale_intervals","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_interval used numerical data.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_intervals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: interval scale — tm_scale_intervals","text":"","code":"tm_scale_intervals( n = 5, style = ifelse(is.null(breaks), \"pretty\", \"fixed\"), style.args = list(), breaks = NULL, interval.closure = \"left\", midpoint = NULL, as.count = NA, values = NA, values.repeat = FALSE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA, label.format = list() )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_intervals.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: interval scale — tm_scale_intervals","text":"n Number intervals. styles (see argument style ) preferred number rather exact number. style Method create intervals. Options \"cat\", \"fixed\", \"sd\", \"equal\", \"pretty\", \"quantile\", \"kmeans\", \"hclust\", \"bclust\", \"fisher\", \"jenks\", \"dpih\", \"headtails\", \"log10_pretty\". See details classInt::classIntervals() (extra arguments can passed via style.args). style.args List extra arguments passed classInt::classIntervals(). breaks Interval breaks (used required style==\"fixed\") interval.closure value determines whether intervals closed: \"left\" \"right\". .count = TRUE, inverval.closure always set \"left\". midpoint data value interpreted midpoint. default set 0 negative positive values present. Useful values diverging colors. case, two sides color palette assigned negative respectively positive values. values positive values negative, midpoint set NA, means value corresponds middle color class (see style) mapped middle color. specified sequential color palettes (e.g. \"Blues\"), color palette treated diverging color palette. .count data variable processed count variable? instance, style = \"pretty\", n = 2, value range variable 0 10, column classes .count = TRUE 0; 1 5; 6 10 (note 0 regarded category) whereas .count = FALSE 0 5; 5 10. applicable style \"pretty\", \"fixed\", \"log10_pretty\". default, TRUE style one , variable integer. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"gray25\" \"gray75\"), 0, 0.5 means colors used black middle grey (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_rgb.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: RGB — tm_scale_rgb","title":"Scales: RGB — tm_scale_rgb","text":"Scales: RGB","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_rgb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: RGB — tm_scale_rgb","text":"","code":"tm_scale_rgb(value.na = NA, maxValue = 255)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_rgb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: RGB — tm_scale_rgb","text":"value.na value missing values maxValue maximum value","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scalebar.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: scale bar — tm_scalebar","title":"Map component: scale bar — tm_scalebar","text":"Map component adds scale bar. version 4.0, tm_scalebar() used instead tm_scale_bar (now deprecated), potential confusion tm_scale_x scaling functions (like tm_scale_continuous()).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scalebar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: scale bar — tm_scalebar","text":"","code":"tm_scalebar( breaks, width, text.size, text.color, color.dark, color.light, lwd, position, bg.color, bg.alpha, size = \"deprecated\", stack, frame, frame.lwd, frame.r, margins, z )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scalebar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: scale bar — tm_scalebar","text":"breaks breaks width width text.size text.size text.color text.color color.dark color.dark color.light color.light lwd lwd position position bg.color bg.color bg.alpha bg.alpha size size stack stack frame frame frame.lwd frame.lwd frame.r frame.r margins margins z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: simple features — tm_sf","title":"Map layer: simple features — tm_sf","text":"Map layer draws simple features . Supported visual variables : fill (fill color), col (border color), size point size, shape symbol shape, lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) col_alpha (border color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: simple features — tm_sf","text":"","code":"tm_sf( fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, shape = tm_const(), shape.scale = tm_scale(), shape.legend = tm_legend(), shape.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, linejoin = \"round\", lineend = \"round\", plot.order.list = list(polygons = tm_plot_order(\"AREA\"), lines = tm_plot_order(\"LENGTH\"), points = tm_plot_order(\"size\")), trans.args.list = list(polygons = list(polygons.only = \"yes\"), lines = list(lines.only = \"yes\"), points = list(points.only = \"yes\")), mapping.args.list = list(polygons = list(), lines = list(), points = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256))), zindex = NA, group = NA, group.control = \"check\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: simple features — tm_sf","text":"fill, fill.scale, fill.legend, fill.free Visual variable determines fill color. See details. col, col.scale, col.legend, col.free Visual variable determines col color. See details. size, size.scale, size.legend, size.free Visual variable determines size. See details. shape, shape.scale, shape.legend, shape.free Visual variable determines shape. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin, lineend line join line end. See gpar() details. plot.order.list Specification order spatial features drawn. consists list three elementary geometry types: polygons, lines , points. types, drawn order, tm_plot_order() required. trans.args.list, mapping.args.list lists passed internal transformation mapping functions respectively. list three items, named polygons, lines, points. See tm_polygons(), tm_lines(), tm_dots(). zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). ... passed tm_polygons(), tm_lines(), tm_dots()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: simple features — tm_sf","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: simple features — tm_sf","text":"","code":"data(World) World$geometry[World$continent == \"Africa\"] <- sf::st_centroid(World$geometry[World$continent == \"Africa\"]) World$geometry[World$continent == \"South America\"] <- sf::st_cast(World$geometry[World$continent == \"South America\"], \"MULTILINESTRING\", group_or_split = FALSE) tm_shape(World) + tm_sf()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape.html","id":null,"dir":"Reference","previous_headings":"","what":"Shape (spatial object) specification — tm_shape","title":"Shape (spatial object) specification — tm_shape","text":"Specify shape, spatial object one spatial object class packages: sf, stars, terra.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shape (spatial object) specification — tm_shape","text":"","code":"tm_shape( shp, bbox = NULL, crs = NULL, is.main = NA, name = NULL, unit = NULL, filter = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shape (spatial object) specification — tm_shape","text":"shp Spatial object bbox Bounding box map (used .main = TRUE) crs CRS shp reprojected (used .main = TRUE) .main shp main shape, determines crs bounding box map? name Name shape unit Unit coordinates filter Filter features ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap function to specify all variables in the shape object — tm_shape_vars","title":"tmap function to specify all variables in the shape object — tm_shape_vars","text":"tmap function specify variables shape object","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap function to specify all variables in the shape object — tm_shape_vars","text":"","code":"tm_shape_vars()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: symbols — tm_symbols","title":"Map layer: symbols — tm_symbols","text":"Map layer draws symbols Supported visual variables : fill (fill color), col (border color), size symbol size, shape symbol shape, lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) col_alpha (border color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: symbols — tm_symbols","text":"","code":"tm_symbols( size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, shape = tm_const(), shape.scale = tm_scale(), shape.legend = tm_legend(), shape.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, plot.order = tm_plot_order(\"size\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256)), zindex = NA, group = NA, group.control = \"check\", popup.vars = NA, popup.format = list(), hover = \"\", id = \"\", ... ) tm_dots( fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, plot.order = tm_plot_order(\"size\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256)), zindex = NA, group = NA, group.control = \"check\", ... ) tm_bubbles( size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, plot.order = tm_plot_order(\"size\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256)), zindex = NA, group = NA, group.control = \"check\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: symbols — tm_symbols","text":"size, size.scale, size.legend, size.free Visual variable determines size. See details. fill, fill.scale, fill.legend, fill.free Visual variable determines fill color. See details. col, col.scale, col.legend, col.free Visual variable determines col color. See details. shape, shape.scale, shape.legend, shape.free Visual variable determines shape. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.col) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode. ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: symbols — tm_symbols","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: symbols — tm_symbols","text":"","code":"# load Africa country data data(World, metro) Africa = World[World$continent == \"Africa\", ] metro_A = sf::st_intersection(metro, Africa) #> Warning: attribute variables are assumed to be spatially constant throughout all geometries tm_shape(metro_A) + tm_symbols() tm_shape(Africa) + tm_polygons() + tm_shape(metro_A) + tm_symbols(fill = \"pop1950\", size = \"pop2030\", size.scale = tm_scale(values.scale = 2)) ##### tmap v3 data(World, metro) metro$growth <- (metro$pop2020 - metro$pop2010) / (metro$pop2010 * 10) * 100 tm_shape(World) + tm_fill(\"grey70\") + tm_shape(metro) + tm_bubbles(\"pop2010\", col = \"growth\", border.col = \"black\", border.alpha = .5, style=\"fixed\", breaks=c(-Inf, seq(0, 6, by=2), Inf), palette=\"-RdYlBu\", contrast=1, title.size=\"Metro population\", title.col=\"Growth rate (%)\") + tm_format(\"World\") #> Deprecated tmap v3 code detected. Code translated to v4 #> Variable(s) \"fill\" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette. tm_shape(metro) + tm_symbols(size = \"pop2010\", col=\"pop2010\", shape=\"pop2010\", legend.format = list(text.align=\"right\", text.to.columns = TRUE)) + tm_legend(outside = TRUE, outside.position = \"bottom\", stack = \"horizontal\") #> Deprecated tmap v3 code detected. Code translated to v4 #> Warning: v3 code detected: as of tmap v4, tm_legend should be specified per visual variable (e.g. with the argument fill.legend of tm_polygons if (require(ggplot2) && require(dplyr) && require(tidyr) && require(tmaptools) && require(sf)) { data(NLD_prov) origin_data <- NLD_prov %>% st_set_geometry(NULL) %>% dplyr::mutate(FID= factor(1:dplyr::n())) %>% dplyr::select(FID, origin_native, origin_west, origin_non_west) %>% tidyr::pivot_longer( cols = c(origin_native, origin_west, origin_non_west), names_to = \"origin\", values_to = \"perc\", names_transform = as.factor ) %>% dplyr::arrange(origin, FID) %>% as.data.frame() origin_cols <- get_brewer_pal(\"Dark2\", 3) grobs <- lapply(split(origin_data, origin_data$FID), function(x) { ggplotGrob(ggplot(x, aes(x=\"\", y=-perc, fill=origin)) + geom_bar(width=1, stat=\"identity\") + scale_y_continuous(expand=c(0,0)) + scale_fill_manual(values=origin_cols) + theme_ps(plot.axes = FALSE)) }) names(grobs) <- NLD_prov$name tm_shape(NLD_prov) + tm_polygons(group = \"Provinces\") + tm_symbols(size=\"population\", shape=\"name\", shapes=grobs, sizes.legend=c(.5, 1,3)*1e6, scale=1, legend.shape.show = FALSE, legend.size.is.portrait = TRUE, shapes.legend = 22, title.size = \"Population\", group = \"Charts\", id = \"name\", popup.vars = c(\"population\", \"origin_native\", \"origin_west\", \"origin_non_west\")) + tm_add_legend(type=\"fill\", group = \"Charts\", col=origin_cols, labels=c(\"Native\", \"Western\", \"Non-western\"), title=\"Origin\") + tm_format(\"NLD\") grobs2 = grobs grobs2[[6]] = 21 NLD_prov$population[1:5] = 500000 tm_shape(NLD_prov) + tm_polygons(group = \"Provinces\") + tm_symbols(shape=\"name\", fill = \"red\", col = \"blue\", size = \"population\", size.scale = tm_scale_continuous(values.scale = 4), shape.scale = tm_scale_categorical(values = grobs2), shape.legend = tm_legend_hide()) } #> Loading required package: ggplot2 #> Loading required package: dplyr #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union #> Loading required package: tidyr #> Loading required package: tmaptools #> Loading required package: sf #> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE #> Deprecated tmap v3 code detected. Code translated to v4 # TIP: check out these examples in view mode, enabled with tmap_mode(\"view\") if (FALSE) { if (require(rnaturalearth)) { airports <- ne_download(scale=10, type=\"airports\", returnclass = \"sf\") airplane <- tmap_icons(system.file(\"img/airplane.png\", package = \"tmap\")) current.mode <- tmap_mode(\"view\") tm_shape(airports) + tm_symbols(shape=airplane, size=\"natlscale\", legend.size.show = FALSE, scale=1, border.col = NA, id=\"name\", popup.vars = TRUE) #+ tm_view(set.view = c(lon = 15, lat = 48, zoom = 4)) tmap_mode(current.mode) } } ##################################################################################### if (FALSE) { # plot all available symbol shapes: if (require(ggplot2)) { ggplot(data.frame(p=c(0:25,32:127))) + geom_point(aes(x=p%%16, y=-(p%/%16), shape=p), size=5, fill=\"red\") + geom_text(mapping=aes(x=p%%16, y=-(p%/%16+0.25), label=p), size=3) + scale_shape_identity() + theme(axis.title=element_blank(), axis.text=element_blank(), axis.ticks=element_blank(), panel.background=element_blank()) } } tm_shape(metro) + tm_symbols(\"pop2010\", size.scale = tm_scale_continuous(n = 8, values.scale = 3), shape = 22) #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). data(\"NLD_prov\") NLD_prov$x = seq(10, by = 5, length.out = 12) tm_shape(NLD_prov) + tm_symbols(size = \"x\", size.scale = tm_scale_continuous(values.scale = 4)) + tm_text(text = \"x\") tm_shape(metro) + tm_symbols(\"pop2010\", fill = \"pop2020\", fill.scale = tm_scale_continuous(), size.scale = tm_scale_continuous(), shape = 22)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: text — tm_text","title":"Map layer: text — tm_text","text":"Map layer draws symbols Supported visual variables : text (text ) col (color), size (font size), fontface (font face).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: text — tm_text","text":"","code":"tm_text( text = tm_const(), text.scale = tm_scale(), text.legend = tm_legend(), text.free = NA, size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, fontface = tm_const(), fontface.scale = tm_scale(), fontface.legend = tm_legend(), fontface.free = NA, fontfamily = \"\", shadow = FALSE, plot.order = tm_plot_order(\"AREA\", reverse = FALSE, na.order = \"bottom\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(clustering = FALSE), zindex = NA, group = NA, group.control = \"check\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: text — tm_text","text":"text, text.scale, text.legend, text.free Visual variable determines text. See details. size, size.scale, size.legend, size.free Visual variable determines font size. See details. col, col.scale, col.legend, col.free Visual variable determines col color. See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See Details. fontface, fontface.scale, fontface.legend, fontface.free Visual variable determines font face. See Details. fontfamily font family. See gpar() details. shadow Shadow behind text. Logical color. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: text — tm_text","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: text — tm_text","text":"","code":"data(rivers) tm_shape(rivers) + tm_lines() tm_shape(rivers) + tm_lines(lwd = \"scalerank\") tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lwd.scale = tm_scale_continuous(values.scale = 2, n = 20), lwd.legend = tm_legend(orientation = \"landscape\", item.width = 2), col = \"type\", col.scale = tm_scale(values = c(\"darkblue\", \"darkred\"))) tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lty = \"scalerank\", col = \"scalerank\", col.scale = tm_scale_categorical(), lty.legend = tm_legend_combine(\"lwd\"), col.legend = tm_legend_combine(\"lwd\")) ### tmap3 tm_shape(World) + tm_fill() + tm_shape(rivers) + tm_lines(col=\"black\", lwd=\"scalerank\", scale=2, legend.lwd.show = FALSE) + tm_style(\"cobalt\", title = \"Rivers of the World\") + tm_format(\"World\") #> Deprecated tmap v3 code detected. Code translated to v4"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_title.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: title — tm_title","title":"Map component: title — tm_title","text":"Map component adds title","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_title.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: title — tm_title","text":"","code":"tm_title( text, size, color, padding, fontface, fontfamily, stack, just, frame, frame.lwd, frame.r, bg.color, bg.alpha, position, width, height, group.frame, resize.as.group, z ) tm_title_in(text, ..., position = tm_pos_in(\"left\", \"top\")) tm_title_out(text, ..., position = tm_pos_out(\"center\", \"top\"))"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_title.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: title — tm_title","text":"text text title size font size title color color padding padding fontface font face fontfamily font family stack stack just just frame frame frame.lwd frame.lwd frame.r frame.r bg.color bg.color bg.alpha bg.alpha position position width width height height group.frame group.frame resize..group resize..group z z ... passed tm_title","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_view.html","id":null,"dir":"Reference","previous_headings":"","what":"View mode options — tm_view","title":"View mode options — tm_view","text":"View mode options. options specific view mode.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_view.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"View mode options — tm_view","text":"","code":"tm_view( use.WebGL, control.position, control.bases, control.overlays, set.bounds, set.view, set.zoom.limits, leaflet.options )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_view.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"View mode options — tm_view","text":"use.WebGL use webGL layers leafgl control.position position control attribute control.bases base layers control.overlays overlay layers set.bounds logical determines whether maximum bounds set, bounding box. applicable plot mode. view mode, passed setMaxBounds() set.view numeric vector determines view. Either vector three: lng, lat, zoom, single value: zoom. See setView(). applicable bbox specified set.zoom.limits numeric vector two set minimum maximum zoom levels (see tileOptions()). leaflet.options options passed leafletOptions()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_xlab.html","id":null,"dir":"Reference","previous_headings":"","what":"Map: x and y labels — tm_xlab","title":"Map: x and y labels — tm_xlab","text":"x y labels maps","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_xlab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map: x and y labels — tm_xlab","text":"","code":"tm_xlab(text, size, color, rotation, space, fontface, fontfamily, side) tm_ylab(text, size, color, rotation, space, fontface, fontfamily, side)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_xlab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map: x and y labels — tm_xlab","text":"text text title size font size title color color rotation rotation degrees space space label map number line heights fontface font face fontfamily font family side side: \"top\" \"bottom\" tm_xlab \"left\" \"right\" tm_ylab","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-element.html","id":null,"dir":"Reference","previous_headings":"","what":"Stacking of tmap elements — tmap-element","title":"Stacking of tmap elements — tmap-element","text":"plus operator allows stack tmap elements (functions prefix tm_)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Stacking of tmap elements — tmap-element","text":"","code":"# S3 method for tmap +(e1, e2)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stacking of tmap elements — tmap-element","text":"e1 first tmap element e2 second tmap element","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Thematic Map Visualization — tmap-package","title":"Thematic Map Visualization — tmap-package","text":"Thematic maps geographical maps spatial data distributions visualized. package offers flexible, layer-based, easy use approach create thematic maps, choropleths bubble maps. based grammar graphics, resembles syntax ggplot2.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Thematic Map Visualization — tmap-package","text":"page provides brief overview package functions. See vignette(\"tmap_sneak_peek\") short introduction examples.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"main-plotting-method","dir":"Reference","previous_headings":"","what":"Main plotting method","title":"Thematic Map Visualization — tmap-package","text":"Shape specification: Aesthetics base layers: Aesthetics derived layers: Faceting (small multiples) Attributes: Layout element: Change options: Create icons:","code":""},{"path":[]},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Thematic Map Visualization — tmap-package","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Thematic Map Visualization — tmap-package","text":"Martijn Tennekes mtennekes@gmail.com","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapAddLayerOptions.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","title":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","text":"Internal tmap function add default value layer functions","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapAddLayerOptions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","text":"","code":"tmapAddLayerOptions(option, id, value)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapAddLayerOptions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","text":"option, one : \"value.const\", \"value.na\", \"value.blank\", \"values.var\", 'values.range', \"value.neutral\", \"scales.var\" id name visual variable layer, format \"x.y\", x visual variable y layer. also possible set x ; applies layer functions. value value","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta1.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","title":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","text":"Internal method extracts meta data shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","text":"","code":"tmapGetShapeMeta1(shp, o)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","text":"shp shape object o list options","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta2.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","title":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","text":"Internal method extracts meta data shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","text":"","code":"tmapGetShapeMeta2(shp, smeta, o)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","text":"shp shape o list options shape meta (tmapGetShapeMeta1)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapShape.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that processed shape objects — tmapShape","title":"Internal method that processed shape objects — tmapShape","text":"Internal method processed shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapShape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that processed shape objects — tmapShape","text":"","code":"tmapShape(shp, is.main, crs, bbox, unit, filter, shp_name, smeta, o, tmf)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapShape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that processed shape objects — tmapShape","text":"shp shp .main .main crs crs bbox bbox unit unit filter filter shp_name shp_name smeta smeta o o tmf tmf","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSplitShp.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that split shape objects — tmapSplitShp","title":"Internal method that split shape objects — tmapSplitShp","text":"Internal method split shape objects. far, used split stars object (dimension attributes)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSplitShp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that split shape objects — tmapSplitShp","text":"","code":"tmapSplitShp(shp, split_stars_dim)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSplitShp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that split shape objects — tmapSplitShp","text":"shp shape split_stars_dim name dimension split (\"\" skip)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSubsetShp.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that subsets data from shape objects — tmapSubsetShp","title":"Internal method that subsets data from shape objects — tmapSubsetShp","text":"Internal method subsets data shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSubsetShp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that subsets data from shape objects — tmapSubsetShp","text":"","code":"tmapSubsetShp(shp, vars)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSubsetShp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that subsets data from shape objects — tmapSubsetShp","text":"shp shape vars vector variable names","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":null,"dir":"Reference","previous_headings":"","what":"Create animation — tmap_animation","title":"Create animation — tmap_animation","text":"Create gif animation video tmap plot.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create animation — tmap_animation","text":"","code":"tmap_animation( tm, filename = NULL, width = NA, height = NA, dpi = NA, delay = 40, fps = NA, loop = TRUE, outer.margins = NA, asp = NULL, scale = NA, restart.delay = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create animation — tmap_animation","text":"tm tmap list tmap objects. tm tmap object, facets created, nrow ncol tm_facets() set 1 order create one map per frame. filename filename. omitted (default), animation shown viewer browser. specified, gif file video file (.e. mp4). package gifski required create gif animation. package av (uses FFmpeg library) required video formats. mp4 format recommended many video formats supported, wmv, avi, mkv. width, height width height animation file (pixels). Required tm list, recommended specify advance tm tmap object. specified latter case, determined aspect ratio map. dpi dots per inch. default 100, can set option output.dpi.animation tmap_options(). delay delay time images (1/100th second). See also fps fps frames per second, calculated 100 / delay. fps specified, delay set 100/fps. loop logical determined whether animation looped, integer value determines many times animation looped. outer.margins (passed tmap_save()) overrides outer.margins argument tm_layout() (unless set NA) asp (passed tmap_save()) specified, overrides asp argument tm_layout(). Tip: set 0 map frame placed edges image. scale (passed tmap_save()) overrides scale argument tm_layout() (unless set NA) restart.delay used anymore ... arguments passed av::av_encode_video()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create animation — tmap_animation","text":"tmap plots supported, series R plots.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create animation — tmap_animation","text":"","code":"if (FALSE) { data(NLD_prov) m1 <- tm_shape(NLD_prov) + tm_polygons(\"yellow\") + tm_facets(along = \"name\") tmap_animation(m1, delay=40) data(World, metro) m2 <- tm_shape(World, projection = \"+proj=eck4\", simplify = 0.5) + tm_fill() + tm_shape(metro) + tm_bubbles(size = paste0(\"pop\", seq(1970, 2030, by=10)), col = \"purple\", border.col = \"black\", border.alpha = .5, scale = 2) + tm_facets(free.scales.symbol.size = FALSE, nrow=1,ncol=1) + tm_format(\"World\") tmap_animation(m2, delay=100, outer.margins = 0) m3 <- lapply(seq(50, 85, by = 5), function(age) { World$at_most <- World$life_exp <= age World_sel <- World[which((World$life_exp <= age) & (World$life_exp > (age - 5))), ] tm_shape(World) + tm_polygons(\"at_most\", palette = c(\"gray95\", \"gold\"), legend.show = FALSE) + tm_shape(World_sel) + tm_text(\"name\", size = \"AREA\", root = 5, remove.overlap = TRUE) + tm_layout(main.title = paste0(\"Life expectency at most \", age), frame = FALSE) }) tmap_animation(m3, width = 1200, height = 600, delay = 100) m4 <- tm_shape(World) + tm_polygons() + tm_shape(metro) + tm_bubbles(col = \"red\") + tm_text(\"name\", ymod = -1) + tm_facets(by = \"name\", free.coords = F, nrow = 1, ncol = 1) + tm_layout(panel.show = FALSE, frame = FALSE) tmap_animation(m4, filename = \"World_cities.mp4\", width=1200, height = 600, fps = 2, outer.margins = 0) }"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":null,"dir":"Reference","previous_headings":"","what":"Arrange small multiples in grid layout — tmap_arrange","title":"Arrange small multiples in grid layout — tmap_arrange","text":"Arrange small multiples grid layout. Normally, small multiples created specifying multiple variables one aesthetic specifying argument (see tm_facets()). function can used arrange custom small multiples grid layout.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arrange small multiples in grid layout — tmap_arrange","text":"","code":"tmap_arrange( ..., ncol = NA, nrow = NA, widths = NA, heights = NA, sync = FALSE, asp = 0, outer.margins = 0.02 ) knit_print.tmap_arrange(x, ..., options = NULL) # S3 method for tmap_arrange print(x, knit = FALSE, ..., options = NULL)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arrange small multiples in grid layout — tmap_arrange","text":"... tmap objects one list tmap objects. number multiples can plot limited (see details). ncol number columns nrow number rows widths vector column widths. add 1 length equal ncol heights vector row heights. add 1 length equal nrow sync logical. navigation view mode (zooming panning) synchronized? default FALSE. asp aspect ratio. aspect ratio map. Normally, controlled asp argument tm_layout() (also tmap option). argument overwrite , unless set NULL. default value asp 0, means aspect ratio adjusted size device divided number columns rows. asp set NA, also default value tm_layout(), aspect ratio adjusted used shapes. outer.margins outer.margins, numeric vector four single value. defines outer margins multiple. overwrite outer.margins argument tm_layout(), unless set NULL. x tmap_arrange object (returned tmap_arrange()) options options passed knitr::knit_print() knit knitr::knit_print() enabled, normal base::print() function?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Arrange small multiples in grid layout — tmap_arrange","text":"global option tmap.limits controls limit number facets plotted. default, tmap_options(tmap.limits = c(facets.view=4, facets.plot=64)). maximum number interactive facets set four since otherwise may become slow.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arrange small multiples in grid layout — tmap_arrange","text":"","code":"tm1 = tm_shape(World) + tm_polygons(\"HPI\") tm2 = tm_shape(metro) + tm_bubbles(size = \"pop2020\") tmap_arrange(tm1, tm2)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_design_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the design mode — tmap_design_mode","title":"Set the design mode — tmap_design_mode","text":"-called \"design mode\" enabled, inner outer margins, legend position, aspect ratio shown explicitly plot mode. Also, information aspect ratios printed console. function sets global option tmap.design.mode. can used toggle function without arguments.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_design_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the design mode — tmap_design_mode","text":"","code":"tmap_design_mode(design.mode)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_design_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the design mode — tmap_design_mode","text":"design.mode Logical value determines design mode. omitted design mode toggled.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_devel_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the development mode — tmap_devel_mode","title":"Set the development mode — tmap_devel_mode","text":"-called \"development mode\" enabled, helpful messages timings printed console","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_devel_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the development mode — tmap_devel_mode","text":"","code":"tmap_devel_mode(devel.mode)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_devel_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the development mode — tmap_devel_mode","text":"devel.mode logical value determines development mode. omitted development mode toggled.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Get or add format options — tmap_format","title":"Get or add format options — tmap_format","text":"Format options tmap options shape dependent. tmap_format() predefined formats can retrieved. values specific format can retrieved tmap_format(format), format name format. function tmap_format_add() used add format.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get or add format options — tmap_format","text":"","code":"tmap_format(format) tmap_format_add(..., name)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get or add format options — tmap_format","text":"format Name format. Run tmap_format() see choices. ... Options tm_layout() tm_view(). Can also list options. name Name new format.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get or add format options — tmap_format","text":"function tmap_format() returns names available formats. format defined, returns option list corresponding format.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get or add format options — tmap_format","text":"","code":"# available formats tmap_format() #> available formats are: \"World\", \"World_wide\", \"NLD\", \"NLD_wide\" # create option list to be used as a new format World_small = tmap_format(\"World\") World_small$scale = 2 # add format tmap_format_add(World_small, name = \"World_small\") #> format World_small succesfully added. Use this format with tm_format(\"World_small\") # observe that World_small is successfully added: tmap_format() #> available formats are: \"World\", \"World_wide\", \"NLD\", \"NLD_wide\", \"World_small\" data(World) #qtm(World, fill=\"HPI\", format=\"World_small\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":null,"dir":"Reference","previous_headings":"","what":"Specify icons — tmap_icons","title":"Specify icons — tmap_icons","text":"Specifies icons png images, can used markers thematic maps. function marker_icon() specification default marker.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Specify icons — tmap_icons","text":"","code":"tmap_icons( file, width = 48, height = 48, keep.asp = TRUE, just = c(\"center\", \"center\"), as.local = TRUE, ... ) marker_icon()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Specify icons — tmap_icons","text":"file character value/vector containing file path(s) url(s). width width icon. keep.asp, interpreted maximum width. height height icon. keep.asp, interpreted maximum height. keep.asp keep aspect ratio png image. TRUE aspect ratio differs width/height either width height adjusted accordingly. just justification icons relative point coordinates. first value specifies horizontal second value vertical justification. Possible values : \"left\" , \"right\", \"center\", \"bottom\", \"top\". Numeric values 0 specify left alignment 1 right alignment. default value just c(\"center\", \"center\"). .local file url, saved local temporary file? ... arguments passed leaflet::icons(). iconWidth, iconHeight, iconAnchorX iconAnchorY specified, override width height, just.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Specify icons — tmap_icons","text":"icon data (see leaflet::icons())","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_last.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve the last map to be modified or created — tmap_last","title":"Retrieve the last map to be modified or created — tmap_last","text":"Retrieve last map modified created. Works way ggplot2::last_plot(), although difference: tmap_last() returns last call instead stacked tmap-elements.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_last.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve the last map to be modified or created — tmap_last","text":"","code":"tmap_last()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_last.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve the last map to be modified or created — tmap_last","text":"call","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":null,"dir":"Reference","previous_headings":"","what":"Export tmap to the format of the used graphics mode — tmap_leaflet","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"tmap_grid() returns grob object (\"plot\" mode) tmap_leaflet() leaflet object (\"view\" mode).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"","code":"tmap_leaflet(x, show = FALSE, ...) tmap_grid(x, show = FALSE, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"x tmap object. show show map? ... Arguments passed print.tmap return.asp aspect ratio returned? vp viewport (\"plot\" mode)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"tmap_grid() returns grob object (\"plot\" mode) tmap_leaflet() leaflet object (\"view\" mode). case small multiples shown, list returned.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"","code":"map = tm_shape(World) + tm_polygons() tmap_leaflet(map, show = TRUE)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Set tmap mode to static plotting or interactive viewing — tmap_mode","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"Set tmap mode static plotting interactive viewing. global option tmap.mode determines whether thematic maps plot graphics device, shown interactive leaflet map (see also tmap_options(). function tmap_mode wrapper set global option. convenient function ttm, stands toggle thematic map, toggle switch two modes. function ttmp stands toggle thematic map print last map: ttm followed tmap_last(); order words, shows last map mode. recommended use tmap_mode() scripts ttm/ttmp console.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"","code":"tmap_mode(mode = NULL) ttm() ttmp()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"mode One : \"plot\" Thematic maps shown graphics device. default mode, supports tmap's features, small multiples (see tm_facets()) extensive layout settings (see tm_layout()). recommended saving static maps (see tmap_save()). \"view\" Thematic maps viewed interactively web browser RStudio's Viewer pane. Maps fully interactive tiles OpenStreetMap map providers (see tm_tiles()). See also tm_view() options related \"view\" mode. mode generates leaflet::leaflet() widget, can also directly obtained tmap_leaflet(). R Markdown, possible publish HTML page. couple constraints comparison \"plot\": map always projected according Web Mercator projection. Although projection de facto standard interactive web-based mapping, lacks equal-area property, important many thematic maps, especially choropleths (see examples tm_shape()). Small multiples supported legend made aesthetics regarding size, symbol size line width. Text labels supported (yet) layout options set tm_layout()) regarding map format used. However, styling options still apply.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"mode changing","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"","code":"tmap_mode() #> current tmap mode is \"plot\" tmap_mode(\"plot\") #> tmap mode set to 'plot' tm_shape(World) + tm_polygons(\"HPI\") tmap_mode(\"view\") #> tmap mode set to 'view' tm_shape(World) + tm_polygons(\"HPI\") ttm() #> tmap mode set to 'plot' tm_shape(World) + tm_polygons(\"HPI\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_options.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap options — tmap_options","title":"tmap options — tmap_options","text":"tmap options","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap options — tmap_options","text":"","code":"tmap_options(...) tmap_options_mode(mode = NA, default.options = FALSE) tm_options(...) tmap_options_diff() tmap_options_reset() tmap_options_save(style)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"tmap options — tmap_options","text":"... See details mode mode, e.g. \"plot\" \"view\" default.options return default options current options? style style, see tmap_style() available styles","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":null,"dir":"Reference","previous_headings":"","what":"Save tmap — tmap_save","title":"Save tmap — tmap_save","text":"Save tmap file. can either static plot (e.g. png) interactive map (html).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save tmap — tmap_save","text":"","code":"tmap_save( tm = NULL, filename = NA, device = NULL, width = NA, height = NA, units = NA, dpi = NA, outer.margins = NA, asp = NULL, scale = NA, insets_tm = NULL, insets_vp = NULL, add.titles = TRUE, in.iframe = FALSE, selfcontained = !in.iframe, verbose = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save tmap — tmap_save","text":"tm tmap object filename filename including extension, optionally path. extensions pdf, eps, svg, wmf (Windows ), png, jpg, bmp, tiff, html supported. extension missing, file saved static plot \"plot\" mode interactive map (html) \"view\" mode (see details). default format static plots png, can changed using option \"output.format\" tmap_options(). NA (default), file saved \"tmap01\" default format, number incremented file already exists. device graphic device use. Either device function (e.g., png cairo_pdf) text indicating selected graphic device: \"pdf\", \"eps\", \"svg\", \"wmf\" (Windows ), \"png\", \"jpg\", \"bmp\", \"tiff\". NULL, graphic device guessed based filename argument. height, width width height plot (applicable html files). Units set argument units. one specified, calculated using formula asp = width / height, asp estimated aspect ratio map. missing, set width * height equal option \"output.size\" tmap_options(). default 49, meaning map square (aspect ratio 1) width height set 7. units units width height (\"\", \"cm\", \"mm\"). default, pixels (\"px\") used either width height set value greater 50. Else, units inches (\"\") dpi dots per inch. applicable raster graphics. default set 300, can changed using option \"output.dpi\" tmap_options(). outer.margins overrides outer.margins argument tm_layout() (unless set NA) asp specified, overrides asp argument tm_layout(). Tip: set 0 map frame placed edges image. scale overrides scale argument tm_layout() (unless set NA) insets_tm tmap object inset map, list tmap objects multiple inset maps. number tmap objects equal number viewports specified insets_vp. insets_vp viewport inset map, list viewports multiple inset maps. number viewports equal number tmap objects specified insets_tm. add.titles add titles leaflet object. .iframe interactive map saved iframe? , two HTML files saved; one small parent HTML file iframe container, one large child HTML file actual widget. See widgetframe::saveWidgetframe() details. default FALSE means one large HTML file saved (see saveWidget()). selfcontained interactive map saved, resources (e.g. JavaScript libraries) contained HTML file? FALSE, placed adjacent directory (see also htmlwidgets::saveWidget()). Note HTML file often still large selfcontained = FALSE, since map data (polygons popups), also contained HTML file, usually take space map resources. verbose Deprecated. now controlled tmap option show.messages (see tmap_options()) ... arguments passed device functions saveWidget() saveWidgetFrame()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save tmap — tmap_save","text":"","code":"if (FALSE) { data(NLD_muni, NLD_prov) m <- tm_shape(NLD_muni) + tm_fill(col=\"population\", convert2density=TRUE, style=\"kmeans\", title=expression(\"Population (per \" * km^2 * \")\")) + tm_borders(\"black\", alpha=.5) + tm_shape(NLD_prov) + tm_borders(\"grey25\", lwd=2) + tm_style(\"classic\") + tm_format(\"NLD\", inner.margins = c(.02, .15, .06, .15)) + tm_scale_bar(position = c(\"left\", \"bottom\")) + tm_compass(position=c(\"right\", \"bottom\")) tmap_save(m, \"choropleth.png\", height = 7) # height interpreted in inches tmap_save(m, \"choropleth_icon.png\", height = 100, scale = .1) # height interpreted in pixels data(World) m2 <- tm_shape(World) + tm_fill(\"well_being\", id=\"name\", title=\"Well-being\") + tm_format(\"World\") # save image tmap_save(m2, \"World_map.png\", width=1920, height=1080, asp=0) # cut left inner margin to make sure Antarctica is snapped to frame tmap_save(m2 + tm_layout(inner.margins = c(0, -.1, 0.05, 0.01)), \"World_map2.png\", width=1920, height=1080, asp=0) # save interactive plot tmap_save(m2, \"World_map.html\") }"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":null,"dir":"Reference","previous_headings":"","what":"Set or get the default tmap style — tmap_style","title":"Set or get the default tmap style — tmap_style","text":"Set get default tmap style. Without arguments, current style returned. Also available styles displayed. style set, corresponding tmap options (see tmap_options()) set accordingly. default style (.e. loading package) \"white\".","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set or get the default tmap style — tmap_style","text":"","code":"tmap_style(style)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set or get the default tmap style — tmap_style","text":"style Name style. omitted, tmap_style() returns current style also shows available styles. style specified, tmap_style() sets style accordingly. Note case, tmap options (see tmap_options()) reset according style definition. See tm_layout() predefined styles, tmap_style_catalogue (migrated v4 yet) creating catalogue.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set or get the default tmap style — tmap_style","text":"style changing","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set or get the default tmap style — tmap_style","text":"Note tm_style() used within plot call (affects plot), whereas tmap_style() sets style globally. loading style, options defined style (.e. difference default \"white\" style) can obtained tmap_options_diff(). documentation tmap_options() (details examples) shows new style created.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set or get the default tmap style — tmap_style","text":"","code":"tmap_style() #> current tmap style is \"v3 (modified)\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"v3\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\") tmap_style(\"cobalt\") #> tmap style set to \"cobalt\" #> other available styles are: \"white\", \"gray\", \"natural\", \"albatross\", \"classic\", \"v3\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\") # for backwards compatibility, the styles of tmap versions 1-3 are also included: tmap_style(\"v3\") #> tmap style set to \"v3\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\") tmap_style(\"cobalt_v3\") #> tmap style set to \"cobalt_v3\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"v3\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/v4-not-yet.html","id":null,"dir":"Reference","previous_headings":"","what":"These functions will be implemented soon — v4-not-yet","title":"These functions will be implemented soon — v4-not-yet","text":"functions implemented soon","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/v4-not-yet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"These functions will be implemented soon — v4-not-yet","text":"","code":"tm_squares() tm_iso() tm_markers() tm_logo() tm_minimap()"},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-40-development-version","dir":"Changelog","previous_headings":"","what":"tmap 4.0 (development version)","title":"tmap 4.0 (development version)","text":"consistency ggplot2, tm_polygons() now recognizes fill argument instead col.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-4","dir":"Changelog","previous_headings":"","what":"tmap 3.3-4","title":"tmap 3.3-4","text":"CRAN release: 2023-09-12 (!) last version tmap 3.x. Next CRAN version tmap 4.x (release planned end 2023) fixed bug (stars appeared upside plot mode) fixed newly introduced shiny bug (#767)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-3","dir":"Changelog","previous_headings":"","what":"tmap 3.3-3","title":"tmap 3.3-3","text":"CRAN release: 2022-03-02 added device tmap_save() fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-2","dir":"Changelog","previous_headings":"","what":"tmap 3.3-2","title":"tmap 3.3-2","text":"CRAN release: 2021-06-16 Worlds fixed (now ‘s2’ proof, see GitHub issue #564)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-1","dir":"Changelog","previous_headings":"","what":"tmap 3.3-1","title":"tmap 3.3-1","text":"CRAN release: 2021-03-15 fixed view titles added html.escape popup.format control whether html code escaped view popups fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33","dir":"Changelog","previous_headings":"","what":"tmap 3.3","title":"tmap 3.3","text":"CRAN release: 2021-01-19 tmap_grob() added, exports tmap plots grob objects (grid package) SpatRaster objects (terra package) supported fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-32","dir":"Changelog","previous_headings":"","what":"tmap 3.2","title":"tmap 3.2","text":"CRAN release: 2020-09-15 tmap_animation() improved: now using av gifski hood; added progress bar; lists tmap objects supported; improved default settings improved tmapOutput(); now works reactive shiny objects improved internally used margins; also small exported maps look good (see example tmap_save()) improved tmap_design_mode(); tmap.design.mode now global option (tmap option anymore) reexported providers leafet added show.warnings tmap_options() added width argument tm_credits() tm_text() improved: added “id” argument, tm_remove_layer() can applied ","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-31","dir":"Changelog","previous_headings":"","what":"tmap 3.1","title":"tmap 3.1","text":"CRAN release: 2020-07-09 interactive maps origin CRS working: tmap_options(projection = 0, basemaps = NULL) added tm_mouse_coordinates() show mouse coordinates view mode added tmap_design_mode() toggle design mode. made backgrond symbol grob shapes transparent added .iframe selfcontained tmap_save() improved tm_add_legend(): added type = \"title\" title legend elements added ttmp() shows last map mode. fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-30","dir":"Changelog","previous_headings":"","what":"tmap 3.0","title":"tmap 3.0","text":"CRAN release: 2020-04-09 [!] spatial rasters/arrays now implemented using stars package (instead raster package) .count argument added layer functions; numeric variables can treated count variables (integers) drop.levels argument added layer functions allows drop unused levels new style added color classes: “dpih” “headtails”; also added style.args pass arguments classInt::classIntervals() grid labels specification per axis fixed bug geometry collection","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-23-2","dir":"Changelog","previous_headings":"","what":"tmap 2.3-2","title":"tmap 2.3-2","text":"CRAN release: 2020-01-19 probably last version release tmap 3.0 many small improvements bug fixes (see GitHub) first stars supported (full support expected tmap 3.0) replaced projection shortcuts \"epsg/proj4strings\" examples","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-23-1","dir":"Changelog","previous_headings":"","what":"tmap 2.3-1","title":"tmap 2.3-1","text":"CRAN release: 2019-09-17 improved popups view mode added validity checks sf objects minor bugs fixed: see GitHub issue list","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-23","dir":"Changelog","previous_headings":"","what":"tmap 2.3","title":"tmap 2.3","text":"CRAN release: 2019-07-18 [!] shiny integration: added tmapOutput(), renderTmap(), tmapProxy(), , tm_remove_layer() improved tmap_save() (regarding default values) improved tm_rgb() (added r g b max.value arguments) added tm_graticules() supported TMS servers view mode, layers can hidden legend group = NULL replaced mapview leafsync minor bugs fixed: see GitHub issue list","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-22","dir":"Changelog","previous_headings":"","what":"tmap 2.2","title":"tmap 2.2","text":"CRAN release: 2019-01-05 improved tm_rgb() improved breaks interactive maps added bbox argument qtm() improved projection shortcut codes (using EPSG database) fixed several bugs (see GitHub)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-21-1","dir":"Changelog","previous_headings":"","what":"tmap 2.1-1","title":"tmap 2.1-1","text":"CRAN release: 2018-08-09 fixed two small bugs","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-21","dir":"Changelog","previous_headings":"","what":"tmap 2.1","title":"tmap 2.1","text":"CRAN release: 2018-08-06 added option max.raster (maximum raster size) made rasters view mode faster bug fixed geometry collection objects without data view mode improved handling manual palettes tmap_arrange() can take list tmap objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-20","dir":"Changelog","previous_headings":"","what":"tmap 2.0","title":"tmap 2.0","text":"CRAN release: 2018-07-15 [!] tmap migrated sp sf. sp objects still supported, internal functions based sf [!] added tm_sf() draws sf objects [!] renamed *_tmap() functions (e.g. save_tmap()) tmap_*() consistency [!] added tm_basemap() tm_tiles(): now, multiple (overlay) tiled maps can shown [!] rearranged tmap options, styles formats. See tmap_options(), tmap_style(), tmap_format(), tm_style() tm_format() [!] added filter argument tm_shape() added colorNULL layer functions added tm_minimap() added remove.NA.facets tm_facets() units data columns supported tmap_animation() enhanced loop options added tmap_tips() changes backwards compatible 1.11-2 vignettes rewritten, including vignette describes changes 2.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-111-2","dir":"Changelog","previous_headings":"","what":"tmap 1.11-2","title":"tmap 1.11-2","text":"CRAN release: 2018-04-10 added references JSS paper (including citation)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-111-1","dir":"Changelog","previous_headings":"","what":"tmap 1.11-1","title":"tmap 1.11-1","text":"CRAN release: 2018-02-13 fixed bug labels argument tm_fill() fixed bug regarding legend symbols facets free scales fixed bug rasters view mode improved popup width view mode","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-111","dir":"Changelog","previous_headings":"","what":"tmap 1.11","title":"tmap 1.11","text":"CRAN release: 2017-11-24 added text.align text..columns legend.format legend.(aes).reverse added layer functions symbol shapes can put list small multiples, named according values variable specified shape argument grid labels can now rotated formatted changed default values free.coords drop.units tm_facets() fixed bug NAs view mode fixed bug dismo::gmap() raster shapes fixed bug ambiguous values aesthetics (e.g. “blue” also variable name) NOTE: last version major update (sf fully replaces sp)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-110","dir":"Changelog","previous_headings":"","what":"tmap 1.10","title":"tmap 1.10","text":"CRAN release: 2017-05-11 [!] tm_scale_bar(), tm_text(), tm_grid() now supported view mode (requires leaflet 1.1.0) added along argument tm_facets(), enables faceting along multiple pages (animation frames) added main.title argument tm_layout added tmap_options(), including new option tmap.unit (“metric” “imperial”“) improved automatic labelling breaks improved legend view mode: missing values shown default (like plot mode) improved bubble scaling view mode fixed bug aspect ratio bug","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-18-1","dir":"Changelog","previous_headings":"","what":"tmap 1.8-1","title":"tmap 1.8-1","text":"CRAN release: 2017-01-29 added tm_rgb() (shortcut rgb rasters) fixed interactive maps R Markdown fixed bug qtm() called without arguments","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-18","dir":"Changelog","previous_headings":"","what":"tmap 1.8","title":"tmap 1.8","text":"CRAN release: 2017-01-03 [!] package split: non-plotting functions migrated tmaptools added tmap_arrange() arranging custom small multiples added simplify argument tm_shape() added error message NA-projected shapes view mode improved unit handling, now can set metric imperial NA values allowed direct color variables sf (simple features) objects supported","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-16-1","dir":"Changelog","previous_headings":"","what":"tmap 1.6-1","title":"tmap 1.6-1","text":"CRAN release: 2016-10-29 improved projections: code efficient now shortcuts renewed. Also, CRS objects now supported project arguments (e.g. tm_shape(), set_projection), .CRS added get_projection get_proj4. Rscript works: methods moved imports depends","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-16","dir":"Changelog","previous_headings":"","what":"tmap 1.6","title":"tmap 1.6","text":"CRAN release: 2016-10-21 [!] tm_symbols() added, create proportional symbol maps: besides bubbles, also supports symbol shapes, png icons, small ggplot2 plots [!] imported cartogram function cartogram package (thanks Sebastian!) [!] reverse geocoding function tmaptools::rev_geocode_OSM() added [!] tm_logo() added added popup.vars base layer functions bounding box (argument bbox tm_shape()) working view mode tmaptools::geocode_OSM() improved: SpatialPointsDataFrame can now returned last_tmap() added, retrieves last produced map crop_shape can also handle polygons cropping area append_data improved; coverage information can retrieved under_coverage over_coverage interpolate parameter added tm_raster() added support custom legend formatting functions legend items can now stacked horizontally legend width height can determined fully manually (negative values legend.height legend.width) argument interval.closure added layer functions determine intervals closed added warnings non-supported elements view mode fixed raster brick bug fixed save_tmap/get_asp_ratifo bug","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-14-1","dir":"Changelog","previous_headings":"","what":"tmap 1.4-1","title":"tmap 1.4-1","text":"CRAN release: 2016-05-07 add just argument anchor text labels, legend attributes position map attributes (scale bar) can placed outside frame added tm_xlab() tm_ylab() RGB raster support, see tm_raster static text (.e titles, credits, legend titles, labels) support expressions updated Europe shape: projection bounding box now consistent Eurostat publications added crop_shape, convenient wrapper around raster::crop()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-14","dir":"Changelog","previous_headings":"","what":"tmap 1.4","title":"tmap 1.4","text":"CRAN release: 2016-03-18 [!] interactive mapping added. Now, tmap two modes: “plot” (graphics device) “view” (interactive viewer, leaflet widget) [!] facets (small multiples) improved: group two variables possible, panel layout added, missing data can shown separately added geocode_OSM(), function find coordinates (now tmaptools::geocode_OSM()) improved set_projection raster objects added double_line offset_line added insets option save_tmap improved default settings contrast argument regarding seq div palettes improved automatic positions legend map attributes (specifically, legend snaps right-hand side without need adjust legend.width, legend attributes position improved double frame enabled) improved tm_layouts()’s design.mode output lwd parameter added tm_scale_bar() tm_compass() fixed bb bug","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-12-1","dir":"Changelog","previous_headings":"","what":"tmap 1.2-1","title":"tmap 1.2-1","text":"fixed bug PROJ.4 version < 4.9.1 improved error messages rd projection reset \"+init=epsg:28992\", since latter now \"+towgs\" item fixed bug print.tmap() returned object","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-12","dir":"Changelog","previous_headings":"","what":"tmap 1.2","title":"tmap 1.2","text":"CRAN release: 2015-12-11 added read_osm(), function read Open Street Map data (now tmaptools::read_osm()) added bb, handy bounding box function added layout themes tm_style tm_format added automatic text labeling added interactive SVG, can opened RStudio (see itmap) added map compass (tm_compass()) added text aesthetics size col added automatic map coloring added earth boundary, useful projected world maps World added warped grid lines (e.g. long-lat lines can shown projected maps) added new color scale modes (enabled style=\"cat\", “cont”, “order”) added save_tmap() added smooth_map, smooth_raster_cover, sample_dots, points_to_raster poly_to_raster added read_GPX improved automatic layout regarding title, legend, map attributes layer arguments, e.g. palette, can take multiple values small multiples improved grid lines (labels can also placed outside frame) arguments free.coords drop.shapes tm_facets() working updated examples vignette fixed viewport bug see ?tmap structured overview tmap functions","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-10","dir":"Changelog","previous_headings":"","what":"tmap 1.0","title":"tmap 1.0","text":"CRAN release: 2015-05-28 added tm_credits() tm_scale_bar() added .master argument tm_shape(), determines shape master added unit unit.size arguments tm_shape() correlates coordinates desired units added tm_polygons(), combination tm_fill() tm_borders() fixed several small bugs","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-08","dir":"Changelog","previous_headings":"","what":"tmap 0.8","title":"tmap 0.8","text":"added tm_raster() improved legend behavior: legend titles set layer functions (instead tm_layout()) removed crop_shape(), since raster::crop() job, , faster --scope functions migrated spatialToolbox package, available https://github.com/mtennekes/spatialToolbox","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-071","dir":"Changelog","previous_headings":"","what":"tmap 0.7.1","title":"tmap 0.7.1","text":"fixed bug scale parameter (global scale set tm_layout())","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-07","dir":"Changelog","previous_headings":"","what":"tmap 0.7","title":"tmap 0.7","text":"CRAN release: 2015-03-27 enhanced small multiples (tm_facets()) respect scaling free coordinate scales added alpha argument tm_layers() transparency added text shadow argument added function split() split shape object sbind() combine shape objects. added automatic legend positioning legend.position = NULL improved number formatting legend improved inner.margins outer.margins. can take one value (e.g. outer.margins=0 rather outer.margins=c(0,0,0,0)) improved qtm(): tm_facets() parameters working, also fixed scale parameter bug improved examples approx_areas, calc_densities fixed bug regarding drawing frame outer.margins=0. fixed bug plotting bubbles improved temp file handling animation_tmap() added functions get set polygon directions, calculate intersection ratios polygons (intersection_shapes)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-06","dir":"Changelog","previous_headings":"","what":"tmap 0.6","title":"tmap 0.6","text":"CRAN release: 2014-07-30 first CRAN version newer version may available https://github.com/r-tmap/tmap get started, see package vignette ‘tmap nutshell’ help files questions suggestions, please contact (mtennekes gmail dot com)","code":""}] +[{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"extendability","dir":"Articles","previous_headings":"","what":"Extendability","title":"tmap v4: a sneak peek","text":"First foremost, tmap v4 fully extendable. precisely, following aspects can extended: Map layers: limited anymore fixed set tm_polygons(), tm_lines(), tm_symbols(), tm_raster() (derivatives tm_borders() tm_dots()), layer interest can developed extension tmap. illustrate tm_cartogram(). layers worthwhile implement tm_donuts(), tm_hexagons(), tm_network(), tm_hillshade(), etc. Aesthetics: many visual variables available. illustrate next section, already implemented 5 new aesthetics tm_polygons(). Moreover, much easier developers add new visual variables map layer functions. Graphics Engine: tmap v3 contains two modes: plot view (based grid graphics leaflet respectively) framework makes possible add modes well. Spatial data classes: tmap v3 build sf stars. also case tmap v4, developers, easier incorporate classes well, like SpatRaster SpatVector terra.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"aesthetics","dir":"Articles","previous_headings":"","what":"Aesthetics","title":"tmap v4: a sneak peek","text":"mentioned , added aesthetics (visual variables), easier developers add new aesthetics. reordered arguments specify configure aesthetics illustrated . arguments specify aesthetics remain . E.g., main aesthetic tm_polygons() fill, defines fill color polygons. However, arguments layer functions organized differently. Thus, aesthetic four arguments: aesthetic (fill) scale (fill.scale) legend (fill.legend) argument decides whether scales applied freely across facets (fill.free) scales legends discussed next sections. can see basic comparison tmap version 3 4 syntax: tmap v4, tm_polygons() aesthetics fill, col, fill_alpha, col_alpha, lwd, lty, eventually also pattern. standard map layers also additional aesthetics. data variable can mapped , using different scales (see next section overview). next example uses fill, lwd (line width), lty (line type) aesthetics: Besides visual mapping aesthetics, map data variables visual variables, also another group aesthetics, namely (data-driven) transformation aesthetics. used transform spatial objects. call data-driven, content data used input spatial transformation. example cartogram, shown next section. polygons distorted size (approximately) proportional data variable.","code":"# tmap v3 tm_shape(World) + tm_polygons(fill = \"HPI\", palette = \"Earth\", title = \"Happy Planet Index\") # tmap v4 tm_shape(World) + tm_polygons(fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\")) # tmap v3 # ... not possible :( # tmap v4 World$life_exp_class = cut(World$life_exp, breaks = seq(40, 85, by = 15)) tm_shape(World, crs = \"+proj=eck4\") + tm_polygons(fill = \"HPI\", fill.scale = tm_scale_continuous(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\"), lwd = \"well_being\", lwd.scale = tm_scale_continuous(value.neutral = 1, values = c(0, 5), label.na = \"\"), lwd.legend = tm_legend(title = \"Well Being\"), lty = \"life_exp_class\", lty.scale = tm_scale_ordinal(values = c(\"dotted\", \"dashed\", \"solid\"), value.na = \"blank\", value.neutral = \"solid\", label.na = \"\"), lty.legend = tm_legend(title = \"Life Expectancy\") )"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"map-layers-e-g--cartogram","dir":"Articles","previous_headings":"","what":"Map layers (e.g. cartogram)","title":"tmap v4: a sneak peek","text":"easy developers add new map layers extension. illustrate new map layer, tm_cartogram(). Cartograms already made tmap v3, explicitly required transforming data using cartogram package mapping. tmap v4, direct function tm_cartogram() (using cartogram package hood), uses transformation aesthetic size inherits visual aesthetics tm_polygons(): nice benefit cartograms directly tmap makes possible use available scaling functions. example, suppose want apply log 10 scale order make cartogram bit “balanced”:","code":"# tmap v3 library(cartogram) World_carto = World |> sf::st_transform(World, crs = \"+proj=eck4\") |> cartogram_cont(weight = \"pop_est\") tm_shape(World_carto, crs = \"+proj=eck4\") + tm_polygons(fill, palette = \"Earth\", title = \"Happy Planet Index\") # tmap v4 if (requireNamespace(\"cartogram\")) { tm_shape(World, crs = \"+proj=eck4\") + tm_cartogram(size = \"pop_est\", fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\")) + tm_place_legends_right(width = 0.2) } # tmap v3 library(cartogram) World_carto = World |> sf::st_transform(World, crs = \"+proj=eck4\") |> dplyr::mutate(pop_est_log10 = log10(pop_est)) |> cartogram_cont(weight = \"pop_est_log10\") tm_shape(World_carto) + tm_polygons(fill, palette = \"Earth\", title = \"Happy Planet Index\") # tmap v4 if (requireNamespace(\"cartogram\")) { tm_shape(World, crs = \"+proj=eck4\") + tm_cartogram(size = \"pop_est\", size.scale = tm_scale_continuous_log1p(), fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"purple_green\"), fill.legend = tm_legend(title = \"Happy Planet Index\")) + tm_place_legends_right(width = 0.2) }"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"scales","dir":"Articles","previous_headings":"","what":"Scales","title":"tmap v4: a sneak peek","text":"Scales used map data variables visual variables. Scales new map v4, used explicitly. following table shows scales currently available: main data type (second column) data type scale supposed applied. scale can applied data type (even though might make sense), one exception: continuous (log10) scales applied visual variables can take finite set values. Examples symbol shape line type. default, tm_scale_categorical(), tm_scale_ordinal(), tm_scale_intervals() used data class factor, ordered numeric respectively. Scales date/time variables included well. main argument scale function values, values visual variables. following table shows type values required visual variable: default values depend visual variable, also scale whether data values diverging. instance, tm_scale_intervals() applied numeric variable negative positive values visual variable fill, diverging color palette used. following map illustrates happens six scale functions applied data variable. use variable life expectancy (round order make sure number unique values limited): Scales existed tmap v3, applied implicitly via several arguments:","code":"data(World) Africa = World[World$continent == \"Africa\", ] Africa$life_exp = round(Africa$life_exp) # tmap v3 tm_shape(Africa) + tm_polygons(rep(\"life_exp\", 5), style = c(\"cat\", \"cat\", \"pretty\", \"cont\", \"log10\"), palette = list(\"Set2\", \"YlOrBr\", \"YlOrBr\", \"YlOrBr\", \"YlOrBr\"), title = \"\") + tm_layout(panel.labels = c(\"categorical scale\", \"ordinal scale\", \"intervals scale\", \"continuous scale\", \"log10 scale\"), inner.margins = c(0.05, 0.2, 0.1, 0.05), legend.text.size = 0.5) # discrete scale is not possible directly, but only via interval breaks: tm_shape(Africa) + tm_polygons(\"life_exp\", style = \"fixed\", palette = \"YlOrBr\", breaks = 49:76, as.count = TRUE, title = \"\") + tm_layout(panel.labels = \"discrete scale\", inner.margins = c(0.05, 0.2, 0.1, 0.05), legend.text.size = 0.5) # tmap v4 tm_shape(Africa) + tm_polygons(rep(\"life_exp\", 6), fill.scale = list(tm_scale_categorical(), tm_scale_ordinal(), tm_scale_intervals(), tm_scale_continuous(), tm_scale_continuous_log(), tm_scale_discrete()), fill.legend = tm_legend(title = \"\", position = tm_pos_in(\"left\", \"top\"))) + tm_layout(panel.labels = c(\"tm_scale_categorical\", \"tm_scale_ordinal\", \"tm_scale_intervals\", \"tm_scale_continuous\", \"tm_scale_continuous_log\", \"tm_scale_discrete\"), inner.margins = c(0.05, 0.2, 0.1, 0.05), legend.text.size = 0.5)"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"multivariate-scales","dir":"Articles","previous_headings":"","what":"Multivariate Scales","title":"tmap v4: a sneak peek","text":"possible assign multiple variables one aesthetic. can done function tm_mv() (stands multivariate). example bivariate choropleth, yet implemented, definitely . Another example multivariate aesthetics glpys, small charts used symbols. following example donut map. current implementation ‘one-trick-pony’ (see https://github.com/mtennekes/donutmaps) tmap v4 much easier:","code":"# tmap v4 tm_shape(World) + tm_symbols( fill = tm_mv(\"well_being\", \"footprint\"), fill.scale = tm_scale_bivariate(scale1 = tm_scale_intervals(breaks = c(2, 5, 6, 8)), scale2 = tm_scale_intervals(breaks = c(0, 3, 6, 20)), values = \"brewer.qualseq\") ) ## Labels abbreviated by the first letters, e.g.: \"0 to 3\" => \"0\" # tmap v4 (not implemented yet) library(tmap) library(tmapGlyps) # which include tm_donuts library(sfnetworks) # for origin-destination data methods tm_mode(\"view\") tm_shape(edges) + tm_halflines(lwd = \"flow\", col = \"dest\", start = 0.5, end = 1.0) + tm_shape(nodes) + tm_donuts(size = \"emplyoees\", parts = tm_mv(\"Amsterdam\", \"Rotterdam\", \"The Hague\", \"Utrecht\", \"Other_municipality\", \"Home_municipality\"))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"legends","dir":"Articles","previous_headings":"","what":"Legends","title":"tmap v4: a sneak peek","text":"may noticed previous examples, legends look bit differently default.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"positioning","dir":"Articles","previous_headings":"Legends","what":"Positioning","title":"tmap v4: a sneak peek","text":"Legends currently placed outside map default tmap v4. ? Simply often space inside map. Furthermore, possible place legends different locations across map: tmap v3 contains many (often complicated) options rather simple things. options set globally via tmap_options() within single plot tm_layout(). tmap v4, directly related layout accessible via tm_layout(). However, ease use, bunch handy shortcut functions, tm_place_legends_left():","code":"# tmap v3 # ... not possible :( # tmap v4 tm_shape(World) + tm_symbols(fill = \"HPI\", size = \"pop_est\", shape = \"income_grp\", size.scale = tm_scale(value.neutral = 0.5), fill.legend = tm_legend(\"Happy Planet Index\", position = tm_pos_in(\"left\", \"top\")), size.legend = tm_legend(\"Population\", position = tm_pos_out(\"left\", \"center\")), shape.legend = tm_legend(\"Income Group\", position = tm_pos_out(\"center\", \"bottom\"))) # tmap v3 tm_shape(World) + tm_symbols(fill = \"HPI\", size = \"pop_est\", shape = \"income_grp\") + tm_layout(legend.outside.position = \"left\", legend.outside.size = 0.2) # tmap v4 tm_shape(World) + tm_symbols(fill = \"HPI\", size = \"pop_est\", shape = \"income_grp\", size.scale = tm_scale(value.neutral = 0.5)) + tm_place_legends_left(0.2)"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"combined-legends","dir":"Articles","previous_headings":"Legends","what":"Combined legends","title":"tmap v4: a sneak peek","text":"Another new feature possibility combine legends directly, quite hassle tmap v3.","code":"# tmap v3 tm_shape(metro) + tm_symbols(col = \"pop2020\", n = 4, size = \"pop2020\", legend.size.show = FALSE, legend.col.show = FALSE) + tm_add_legend(\"symbol\", col = RColorBrewer::brewer.pal(4, \"YlOrRd\"), border.col = \"grey40\", size = ((c(10, 20, 30, 40) * 1e6) / 40e6) ^ 0.5 * 2, labels = c(\"0 mln to 10 mln\", \"10 mln to 20 mln\", \"20 mln to 30 mln\", \"30 mln to 40 mln\"), title = \"Population in 2020\") + tm_layout(legend.outside = TRUE, legend.outside.position = \"bottom\") # tmap v4 tm_shape(metro) + tm_symbols(fill = \"pop2020\", fill.legend = tm_legend(\"Population in 2020\"), size = \"pop2020\", size.scale = tm_scale_intervals(), size.legend = tm_legend_combine(\"fill\"))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"spacing-between-items","dir":"Articles","previous_headings":"Legends","what":"Spacing between items","title":"tmap v4: a sneak peek","text":"design legends () improved. prominently, space argument determines height legend item. specifically, legend item 1 + space line-height. also useful make continuous legends better.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"facets","dir":"Articles","previous_headings":"","what":"Facets","title":"tmap v4: a sneak peek","text":"tmap v4, convenient wrappers tm_facet_wrap() tm_facet_grid(), former wraps facets, latter places facets grid layout. Furthermore, visual variable free argument, determines whether scales free (TRUE) shared (FALSE) across facets. tmap v3 free argument set via tm_facets(), whereas tmap v4 argument moved layer functions: New tmap v4 facet grid, free argument can specified differently rows columns, show next complex (sorry ) example: see map life expectancy shown polygon fill green, GDP per capita red bubbles. maps grouped income group (rows) economy (columns). scale life expectancy set free columns. means scale applied column separately, legend per column. scale GDP per capita applied separately row.","code":"# tmap v3 tm_shape(World) + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\") + tm_facets(\"continent\", nrow = 1, free.scales.fill = FALSE, free.coords = FALSE) # tmap v4 tm_shape(World, crs = \"+proj=robin\") + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\", fill.free = FALSE) + tm_facets_wrap(\"continent\") # tmap v3 tm_shape(World) + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\") + tm_facets(\"continent\", nrow = 1, free.scales.fill = TRUE, free.coords = FALSE) tm_shape(World, crs = \"+proj=robin\") + tm_borders() + tm_shape(World) + tm_polygons(\"life_exp\", fill.free = TRUE) + tm_facets_stack(\"continent\") # tmap v3 # ... not possible :( # tmap v4 tm_shape(World, crs = \"+proj=robin\") + tm_borders() + tm_shape(World) + tm_polygons(fill = \"life_exp\", fill.scale = tm_scale_intervals(values = \"brewer.greens\"), fill.free = c(rows = FALSE, columns = TRUE)) + tm_symbols(size = \"gdp_cap_est\", size.free = c(rows = TRUE, columns = FALSE), fill = \"red\") + tm_facets_grid(\"income_grp\", \"economy\") + tm_layout(meta.margins = c(.2, 0, 0,.1))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"graphic-engines-modes","dir":"Articles","previous_headings":"","what":"Graphic Engines (modes)","title":"tmap v4: a sneak peek","text":"Just like tmap v3, \"plot\" \"view\" mode. However, framework used tmap v4 also facilitates developers write plotting methods modes. instance, CesiumJS great JavaScript library 3d globe visualizations. awesome include R. low-level interface CesiumJS R (similar R package leaflet interface JS library leaflet R), relatively easy developers add new mode 3d visualizations tmap v4.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"backward-compatibility","dir":"Articles","previous_headings":"","what":"Backward compatibility","title":"tmap v4: a sneak peek","text":"early development stage, tmap v3 code work tmap v4. However, tmap v4 stable, backwards compatible. Layer function arguments longer used, breaks palette deprecated, internally redirected new scale functions. Furthermore, options options tmap v4. instance, legends placed outside maps default, small space legend items shown . order keep layout close possible tmap v3, style set options back settings used default tmap v3. can set just one command: tmap_style(\"tmap_v3\")","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"color-palettes","dir":"Articles","previous_headings":"","what":"Color palettes","title":"tmap v4: a sneak peek","text":"huge number directly available color palettes. settled exact details, e.g. palettes include, can obtained. Ideas welcome (https://github.com/r-tmap/tmap/issues/566). current development version, function similar tmaptools::palette_explorer(), renders long png viewer pane RStudio browser: (click image see full png) also possible render color blindness simulation, e.g.: tmap_show_palettes(color_vision_deficiency = \"deutan\"). default palettes use usable color blind people.","code":"# tmap v4 tmap_show_palettes()"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_sneak_peek.html","id":"suggestions","dir":"Articles","previous_headings":"","what":"Suggestions","title":"tmap v4: a sneak peek","text":"suggestions? Please let us know! Via https://github.com/r-tmap/tmap/issues, please use tmap_v4 tag.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"tmap: visual variables","text":"tmap R package spatial data visualization. vignette describes alpha version major update (version 4), CRAN course 2023.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"tmap-4---tmap-3-x","dir":"Articles","previous_headings":"Introduction","what":"tmap 4 - tmap 3.x","title":"tmap: visual variables","text":"tmap 3.x supports several map layer variables, example \"col\", \"size\", \"shape\" tm_symbols() map layer function. many variables tmap 4. Besides visual variables, -called transformation variables also available. transformation variable role change spatial coordinates (instance, create cartogram). visual variable changes appearance spatial object, e.g. fill color line width. can find examples variables . Map layer arguments (e.g. arguments tm_polygons()) much better organized: visual/transformation variable, four arguments. case fill visual variable, : fill, fill.scale, fill.legend fill.free, respectively specify data variable visual value defines polygon fill color, used scaling function, legend layout, whether scales applied freely across facets. input visual/transformation variable can multivariate, sense multiple data variables scaled one transformation visual variable. example bivariate choropleth, cross tabulation two data variables mapped one (bivariate) color palette. User-defined map layer functions can written (e.g. extension package). Like tmap 3.x, tmap 4.0 comes two modes, \"plot\" \"view\" mode. However, modes can added well, may expect extension package tmap.rayshader point (start writing one ). Legends map components (scale bars) can drawn anywhere outside map. layout legends improved made much flexible. possible combine legends, useful data variable applied multiple visual variables using scaling function.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"tmap-4---ggplot2","dir":"Articles","previous_headings":"Introduction","what":"tmap 4 - ggplot2","title":"tmap: visual variables","text":"tmap package similar ggplot2 Grammar Graphics, tailored spatial data visualization, whereas ggplot2 much general. specifically: tmap, visual/transformation variables always specifies map layer functions, whereas ggplot2 aesthetics usually specified plot level. ggplot2, scales determined plot level, whereas tmap, determined map layer level. tmap, spatial data (e.g. sf object) specified tm_shape(). spatial coordinates (x y) considered part data (can changed transformation variables). principle, map layer function can used spatial class. E.g. tm_dots() renders dots sf points data, also works spatial classes: e.g. centroids sf polygons/lines raster data (stars / terra packages). However, ggplot2::ggplot(), spatial class requires custom map layer function, e.g. ggplot2::geom_sf() sf objects. tmap static plot mode interactive mode. …","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"tmap-4---other-r-packages","dir":"Articles","previous_headings":"Introduction","what":"tmap 4 - other R packages","title":"tmap: visual variables","text":"several great R packages spatial data visualization, including: ggplot2, mapview, leaflet, mapsf, generic plot function. interactive \"view\" mode tmap similar mapview sense uses building blocks (packages like leaflet, leafsync, leafgl). Colors important data visualization. purpose, tmap uses cols4all, new R package analyse color palettes, check color-blind-friendliness properties.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"map-layers","dir":"Articles","previous_headings":"","what":"Map layers","title":"tmap: visual variables","text":"(thematic) map consists one map layers. map layer specific set variables determine objects layer drawn. distinguish two type variables: transformation variables visual variables. transformation variable used change spatial coordinates (instance, cartogram distorts polygons). visual variable changes appearance spatial object, e.g. fill color line width. Transformation variables used specific map layers cartogram, whereas visual variables used almost map layers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"visual-variables","dir":"Articles","previous_headings":"","what":"Visual variables","title":"tmap: visual variables","text":"visual variable describes certain visual property drawn object, color, size, shape, line width, line stroke, transparency, fill pattern (ggplot2 called aesthetics). visual variable can specified using constant value (e.g. fill = \"blue\") data-driven (later). can specified constant value, called visual constant. following table shows visual variables used standard map layers. New tmap 4.0 users can write custom map layer functions; another vignette. Important now map layers visual variables can extended needed.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"constant-visual-values","dir":"Articles","previous_headings":"Visual variables","what":"Constant visual values","title":"tmap: visual variables","text":"following code draws gold country polygons. visual variables mentioned previous table used, constant values. instance, polygon borders drawn width lwd colored col. visual variables default value, case border width color respectively 1 \"black\". visual variable specified different value fill, set \"gold\". completely new tmap: function tm_shape() specifies spatial data object, can spatial data object packages sf, stars, terra, sp, raster. subsequent map layer functions (stacked + operator) specify spatial data visualized. next example three layers: basemap OpenTopoMap, country polygon boundaries, dots metropolitan areas: visual variable argument can also specified data variable (e.g., column name). happens case values data variable mapped values corresponding visual variable. example, life expectancy per country shown, put precisely: data variable life expectancy mapped visual variable polygon fill. understand data mapping, consider following schematic dataset: first column contains spatial geometries (case polygons, can also points, lines, raster tiles). second column data variable like show. third column contains visual values, case colors. Important note many ways scale data values visual values. example data values put 5 year intervals sequential discrete blue scale used show . tm_scale_*() family functions, users free create scales. map uses continuous color scale colors CARTO. scales later.","code":"tm_shape(World) + tm_polygons(\"gold\") if (requireNamespace(\"maptiles\")) { tm_basemap(server = \"OpenTopoMap\", zoom = 2, alpha = 0.5) + tm_shape(World, bbox = sf::st_bbox(c(xmin = -180, xmax = 180, ymin = -86, ymax = 86))) + tm_polygons(fill = NA, col = \"black\") + tm_shape(metro) + tm_symbols(size = 0.1, col = \"red\") + tm_layout(inner.margins = rep(0, 4)) } ## Loading required namespace: maptiles tm_shape(World) + tm_polygons(\"life_exp\") ## geom x1 vv1 ## 1 polygon1 72 blue6 ## 2 polygon2 58 blue3 ## 3 polygon3 52 blue2 ## 4 polygon4 73 blue7 ## 5 ... ... ... tm_shape(World) + tm_polygons(\"life_exp\", fill.scale = tm_scale_continuous(values = \"-carto.earth\"), fill.legend = tm_legend(\"Life\\nExpectancy\"))"},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"transformation-variables","dir":"Articles","previous_headings":"","what":"Transformation variables","title":"tmap: visual variables","text":"Besides visual variables, map layer may use spatial transformation variables. used two variables: size deform polygons using continuous cartogram fill color polygons. former example transformation variable. example schematic dataset: data variable x1, example pop_est (population estimation), scaled x1_scaled case normalization using continuous scale. Next, geometries distorted areas proportional x1_scaled (much cartogram algorithm able achieve).","code":"if (requireNamespace(\"cartogram\")) { tm_shape(World, crs = 8857) + tm_cartogram(size = \"pop_est\", fill = \"income_grp\") } ## Loading required namespace: cartogram ## Cartogram in progress... ## geom x1 x_scaled geom_transformed ## 1 polygon1 491,775 0.0007 polygon1' ## 2 polygon2 2,231,503 0.0033 polygon2' ## 3 polygon3 34,859,364 0.0554 polygon3' ## 4 polygon4 4,320,748 0.0067 polygon4' ## 5 ... ... ... ..."},{"path":"https://r-tmap.github.io/tmap/dev/articles/tmap_vv.html","id":"scales","dir":"Articles","previous_headings":"","what":"Scales","title":"tmap: visual variables","text":"visual variable transformation variable can scaled one tm_scale_ functions. illustrate different options, show life expectancy across Africa, round order use categorical scales well. Like tmap 3.x, possible create facets specifying multiple data variable names scales one visual (transformation) variable, case \"fill\": tm_scale_categorical() tm_scale_ordinal() tread data categorical data, ignoring fact actually numbers. difference categorical assume order categories, whereas ordinal . similar factor R can ordered . shown scales can applied numeric data. Note example breaks tm_scale_intervals() similar tick marks tm_scale_continous(). However, using class intervals colors used (case 6 plus color missing values) whereas continuous scale gradient colors used. advantage using class intervals relatively easy read data values map, e.g. value South Africa 55 60, advantage using continuous color scale colors map accurate (unrounded). tm_scale_intervals() possible chose determine breaks (argument style). tm_scale_continous() possible use transformation function: case built-log transformation used (pretty useless particular example data range). Finally, tm_scale_discrete() uses discrete linear scale. Note different tm_scale_ordinal(), use colors values present (categories), instance 53. tm_scale_*() functions can (principle) applied visual transformation variable. Note different ggplot2 scales organized variable type (e.g. ggplot2::scale_fill_continuous()). related another difference ggplot2. tmap, scales set directly map layer function target visual/transformation variable, instance tm_polygons(fill = \"x\", fill.scale = tm_scale_continuous()). ggplot(), scales set outside layer functions. tm_scale_ function (least) following arguments: values, values.repeat, values.range, values.scale, value.na, value.null, value.neutral, labels, label.na, label.null, label.format. value* arguments determine visual values data values mapped. case scale applied visual variable represents color, takes color values color palette. However, instance scale applied line width, values numeric values represent line widths. illustrated following example: defaults value.* arguments stored tmap options. instance contains default color palettes visual variable \"fill\" different types data. instance, data values positive numbers, tm_scale_intervals() tm_scale_continuous() applied, default color palette \"hcl.blues3\", can seen examples . Regarding available color palettes: tmap uses new R package cols4all contains large number well-known color palettes. Please run cols4all::c4a_gui() starts interactive tool (successor tmaptools::palette_explorer()). course, also color palettes can loaded directly via vector color codes.","code":"data(World) Africa = World[World$continent == \"Africa\", ] Africa$life_exp = round(Africa$life_exp) tm_shape(Africa) + tm_polygons(rep(\"life_exp\", 6), fill.scale = list(tm_scale_categorical(), tm_scale_ordinal(), tm_scale_intervals(), tm_scale_continuous(), tm_scale_continuous_log(), tm_scale_discrete()), fill.legend = tm_legend(title = \"\", position = tm_pos_in(\"left\", \"top\"))) + tm_layout(panel.labels = c(\"tm_scale_categorical\", \"tm_scale_ordinal\", \"tm_scale_intervals\", \"tm_scale_continuous\", \"tm_scale_continuous_log\", \"tm_scale_discrete\"), inner.margins = c(0.05, 0.4, 0.1, 0.05), legend.text.size = 0.5) tm_shape(World) + tm_polygons(fill = \"HPI\", fill.scale = tm_scale_intervals(values = \"scico.roma\", value.na = \"grey95\", breaks = c(12,20,30,45))) + tm_symbols(size = \"HPI\", size.scale = tm_scale_intervals(values = c(0.3,0.5, 0.8), value.na = 0.1, breaks = c(12,20,30,45)), col = \"grey30\") tmap_options(\"values.var\")$values.var$fill ## $seq ## [1] \"hcl.blues3\" ## ## $div ## [1] \"pu_gn_div\" ## ## $unord ## [1] \"tol.muted\" ## ## $ord ## [1] \"hcl.blues3\" ## ## $cyc ## [1] \"tol.rainbow_pu_rd\" ## ## $biv ## [1] \"pu_gn_bivs\""},{"path":"https://r-tmap.github.io/tmap/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Martijn Tennekes. Author, maintainer. Jakub Nowosad. Contributor. Joel Gombin. Contributor. Sebastian Jeworutzki. Contributor. Kent Russell. Contributor. Richard Zijdeman. Contributor. John Clouse. Contributor. Robin Lovelace. Contributor. Jannes Muenchow. Contributor. Olivier Roy. Contributor.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tennekes M (2018). “tmap: Thematic Maps R.” Journal Statistical Software, 84(6), 1–39. doi:10.18637/jss.v084.i06.","code":"@Article{, title = {{tmap}: Thematic Maps in {R}}, author = {Martijn Tennekes}, journal = {Journal of Statistical Software}, year = {2018}, volume = {84}, number = {6}, pages = {1--39}, doi = {10.18637/jss.v084.i06}, }"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"tmap-thematic-maps-in-r-","dir":"","previous_headings":"","what":"Thematic Maps","title":"Thematic Maps","text":"tmap actively maintained open-source R-library drawing thematic maps. API based Layered Grammar Graphics resembles syntax ggplot2, popular R-library drawing charts. See source code images.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Thematic Maps","text":"tmap available . Installation straightforward: Linux macOS users new working spatial data R, may fail since additional (non-R) libraries required (automatically installed Windows users). Windows additional installation required. Linux (Ubuntu) See https://geocompx.org/post/2020/installing-r-spatial-packages-linux/. Please address installation issues issue. macOS See http://www.kyngchaos.com. Please address installation issues issue.","code":"install.packages(\"tmap\")"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"development","dir":"","previous_headings":"","what":"Development","title":"Thematic Maps","text":"latest development version can installed using remotes. order use development version tmap, recommended use development version tmaptools well: See NEWS latest features improvements issue list discussions enhancements bugs. want help development package? Please let us know! feedback, requests, tips, bug reports welcome!","code":"# install.packages(\"remotes\") install_github(\"r-tmap/tmaptools\") install_github(\"r-tmap/tmap\") # On Linux, with pak # install.packages(\"pak\") pak::pak(\"r-tmap/tmap\") # Or from r-universe install.packages('tmap', repos = c('https://r-tmap.r-universe.dev', 'https://cloud.r-project.org'))"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Thematic Maps","text":"","code":"library(tmap)"},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"reference","dir":"","previous_headings":"","what":"Reference","title":"Thematic Maps","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39 paper written tmap 1.11-2. See reproducible code using tmap 2.x.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"vignettes","dir":"","previous_headings":"","what":"Vignettes","title":"Thematic Maps","text":"tmap v3: get started! tmap: changed recent versions?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Thematic Maps","text":"tmap RMarkdown","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"presentations","dir":"","previous_headings":"","what":"Presentations","title":"Thematic Maps","text":"Creating thematic maps R (OpenGeoHUB Summer School 2019) Plotting spatial data R (eRum 2018) Exploring presenting maps tmap (useR!2017) tmap: creating thematic maps flexible way (useR!2015)]","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"other-resources","dir":"","previous_headings":"","what":"Other resources","title":"Thematic Maps","text":"Geocomputation R; Making maps R, Robin Lovelace, Jakub Nowosad, Jannes Muenchow R tip: Create maps R Working Spatial Data using tmap, Samantha . Alger Computer World: Mapping R just got whole lot easier National Socio-Environmental Synthesis Center: Maps R Introduction visualizing spatial data R Blog post SpatialControl Blog post TWIAV Computer World: Create maps R 10 (fairly) easy steps Computer World: Great R packages data import, wrangling visualization Tutorial Visualizing spatial data: base shiny - workshop Stack Overflow questions (#tmap)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/index.html","id":"getting-help","dir":"","previous_headings":"","what":"Getting help","title":"Thematic Maps","text":"two main places get help tmap: stackoverflow great source answers common tmap questions. also great place get help, created reproducible example illustrates problem. Please tag questions tmap. request think problem caused bug, please open issue, preferably reproducible example.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":null,"dir":"Reference","previous_headings":"","what":"World and Netherlands map — World","title":"World and Netherlands map — World","text":"Maps world Netherlands (province municipality level), class sf","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"World and Netherlands map — World","text":"","code":"World NLD_prov NLD_muni"},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"World and Netherlands map — World","text":"https://www.naturalearthdata.com/ World https://happyplanetindex.org/ World https://www.cbs.nl/ NLD_prov NLD_muni.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"World and Netherlands map — World","text":"default projections maps Eckhart IV (World) Rijksdriehoekstelsel (Netherlands). See . projection can changed temporarily plotting purposes using projection argument tm_shape(). World World map. default projection world map Eckhart IV since area sizes preserved, important property choropleths. NLD_prov NLD_muni, maps Netherlands province municipality level 2013. used projection Rijksdriehoekstelsel projection. Important: publication maps allowed citing Statistics Netherlands (CBS) Kadaster Nederland source.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/Shapes.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"World and Netherlands map — World","text":"Statistics Netherlands (2014), Hague/Heerlen, Netherlands, https://www.cbs.nl/. Kadaster, Netherlands' Cadastre, Land Registry, Mapping Agency (2014), Apeldoorn, Netherlands, https://www.kadaster.nl/.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/get_fact_levels_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","title":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","text":"Internal tmap function gets factor levels NA's","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/get_fact_levels_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","text":"","code":"get_fact_levels_na(x, o)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/get_fact_levels_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function that gets factor levels with NA's — get_fact_levels_na","text":"x vector o options","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatial data of global land cover — land","title":"Spatial data of global land cover — land","text":"Spatial data global land cover, percent tree cover, elevation class stars. Two attributes object relates global land cover. cover layer classifies status land cover whole globe 20 categories, cover_cls layer uses 8 simplified categories. Percent Tree Cover (trees) represents density trees ground, last attribute represents elevation.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of global land cover — land","text":"","code":"land"},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Spatial data of global land cover — land","text":"object class stars 1080 rows 540 columns.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spatial data of global land cover — land","text":"Important: publication maps allowed cited Tateishi et al. (2014), \"Geospatial Information Authority Japan, Chiba University collaborating organizations.\" shown.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/land.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Spatial data of global land cover — land","text":"Production Global Land Cover Data - GLCNMO2008, Tateishi, R., Thanh Hoan, N., Kobayashi, T., Alsaaideh, B., Tana, G., Xuan Phong, D. (2014), Journal Geography Geology, 6 (3).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/make_by_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function to create by variables (used for faceting) — make_by_vars","title":"Internal tmap function to create by variables (used for faceting) — make_by_vars","text":"Internal tmap function create variables (used faceting)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/make_by_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function to create by variables (used for faceting) — make_by_vars","text":"","code":"make_by_vars(dt, tmf, smeta)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/make_by_vars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to create by variables (used for faceting) — make_by_vars","text":"dt data.table tmf tmf object smeta smeta object","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatial data of metropolitan areas — metro","title":"Spatial data of metropolitan areas — metro","text":"metro includes population time series 1950 (forecasted) 2030. metro areas 1 million inhabitants 2010 included.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of metropolitan areas — metro","text":"","code":"metro"},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Spatial data of metropolitan areas — metro","text":"object class sf (inherits data.frame) 436 rows 13 columns.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Spatial data of metropolitan areas — metro","text":"https://population.un.org/wup/","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/metro.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Spatial data of metropolitan areas — metro","text":"United Nations, Department Economic Social Affairs, Population Division (2014). World Urbanization Prospects: 2014 Revision, CD-ROM Edition.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tm_element.html","id":null,"dir":"Reference","previous_headings":"","what":"Print tm_element — print.tm_element","title":"Print tm_element — print.tm_element","text":"Print tm_element","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tm_element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print tm_element — print.tm_element","text":"","code":"# S3 method for tm_element print(x, ...) # S3 method for tm_shape print(x, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tm_element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print tm_element — print.tm_element","text":"x x ... passed ","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Draw thematic map — print.tmap","title":"Draw thematic map — print.tmap","text":"Draw thematic map.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Draw thematic map — print.tmap","text":"","code":"# S3 method for tmap print(x, return.asp = FALSE, show = TRUE, vp = NULL, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/print.tmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Draw thematic map — print.tmap","text":"x tmap object. return.asp aspect ratio returned? show show map vp viewport (\"plot\" mode) ... used","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":null,"dir":"Reference","previous_headings":"","what":"Quick thematic map plot — qtm","title":"Quick thematic map plot — qtm","text":"Draw thematic map quickly. function convenient wrapper main plotting method stacking tmap-elements. Without arguments search term, functions draws interactive map.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quick thematic map plot — qtm","text":"","code":"qtm( shp, fill = tm_const(), col = tm_const(), size = tm_const(), shape = tm_const(), lwd = tm_const(), lty = tm_const(), fill_alpha = tm_const(), col_alpha = tm_const(), by = NULL, scale = NULL, title = NULL, crs = NULL, bbox = NULL, basemaps = NULL, overlays = NULL, zindex = NA, group = NA, group.control = \"check\", style = NULL, format = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quick thematic map plot — qtm","text":"shp One : shape object, object class defined sf stars package. Objects packages sp raster also supported, discouraged. specified, .e. qtm() executed. case plain interactive map shown. OpenStreetMap search string, e.g. qtm(\"Amsterdam\"). case plain interactive map shown positioned according results search query (OpenStreetMap nominatim) fill, col, size, shape, lwd, lty, fill_alpha, col_alpha Visual variables. data variable name data split, vector two variable names split data two variables (first used rows second columns). See also tm_facets(). scale numeric value serves global scale parameter. font sizes, symbol sizes, border widths, line widths controlled value. parameters symbols.size, text.size, lines.lwd can scaled separately respectively symbols.scale, text.scale, lines.scale. See also .... title main title. legend titles, use X.style, X layer name (see ...). crs Either crs object character value (PROJ.4 character string). default, projection used defined shp object . bbox bounding box. Argument passed tm_shape() basemaps name(s) provider URL tiled basemap. shortcut tm_basemap(). Set NULL disable basemaps. default, set tmap option basemaps. overlays name(s) provider URL tiled overlay map. shortcut tm_tiles(). zindex zindex group group group.control group.control style Layout options (see tm_layout()) define style. See tmap_style() details. format Layout options (see tm_layout()) define format. See tmap_format() details. ... arguments passed tm_* functions. prefix arguments layer function name without \"tm_\" period. instance, palette polygon fill color called fill.palette. following prefixes supported: shape., fill., borders., polygons., symbols., dots., lines., raster., text., layout., grid., facets., view.. Arguments unique name, .e. exist layer function, e.g. convert2density, can also called without prefix.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quick thematic map plot — qtm","text":"tmap-element","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Quick thematic map plot — qtm","text":"first argument shape object (normally specified tm_shape()). next arguments, fill raster, aesthetics main layers. remaining arguments related map layout. argument main layer function, tm_polygons(), can specified (see ...). also possible stack tmap-elements qtm plot. See examples. default, scale bar shown. option can set tmap_options() (argument qtm.scalebar). minimap shown default qtm called without arguments search term. option can set tmap_options() (argument qtm.minimap).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Quick thematic map plot — qtm","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/qtm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quick thematic map plot — qtm","text":"","code":"data(World, rivers, metro) # just the map qtm(World) # choropleth qtm(World, fill = \"economy\", format = \"World\", style = \"col_blind\", projection = \"+proj=eck4\") # choropleth with more specifications qtm(World, fill=\"HPI\", fill.n = 9, fill.palette = \"div\", fill.title = \"Happy Planet Index\", fill.id = \"name\", style = \"gray\", format = \"World\", projection = \"+proj=eck4\") # this map can also be created with the main plotting method, # which is recommended in this case. if (FALSE) { tm_shape(World, projection = \"+proj=eck4\") + tm_polygons(\"HPI\", n = 9, palette = \"div\", title = \"Happy Planet Index\", id = \"name\") + tm_style(\"gray\") + tm_format(\"World\") } # bubble map if (FALSE) { qtm(World, borders = NULL) + qtm(metro, symbols.size = \"pop2010\", symbols.title.size= \"Metropolitan Areas\", symbols.id= \"name\", format = \"World\") } # dot map if (FALSE) { current.mode <- tmap_mode(\"view\") qtm(metro, bbox = \"China\") tmap_mode(current.mode) # restore mode } if (FALSE) { # without arguments, a plain interactive map is shown (the mode is set to view) qtm() # search query for OpenStreetMap nominatim qtm(\"Amsterdam\") }"},{"path":"https://r-tmap.github.io/tmap/dev/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. leaflet providers","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatial data of rivers — rivers","title":"Spatial data of rivers — rivers","text":"Spatial data rivers","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of rivers — rivers","text":"","code":"rivers"},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Spatial data of rivers — rivers","text":"object class sf (inherits data.frame) 1616 rows 5 columns.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/rivers.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Spatial data of rivers — rivers","text":"https://www.naturalearthdata.com","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/shapeTM.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function to create a tmap shape — shapeTM","title":"Internal tmap function to create a tmap shape — shapeTM","text":"Internal tmap function create tmap shape","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/shapeTM.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function to create a tmap shape — shapeTM","text":"","code":"shapeTM(shp, tmapID = NULL, bbox = NULL, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/shapeTM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to create a tmap shape — shapeTM","text":"shp Shape file tmapID tmap Identifier bbox bounding box","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/theme_ps.html","id":null,"dir":"Reference","previous_headings":"","what":"ggplot2 theme for proportional symbols — theme_ps","title":"ggplot2 theme for proportional symbols — theme_ps","text":"ggplot2 theme proportional symbols. default, theme shows plotting area, without titles, axes, legend.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/theme_ps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ggplot2 theme for proportional symbols — theme_ps","text":"","code":"theme_ps( base_size = 12, base_family = \"\", plot.axes = FALSE, plot.legend = FALSE )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/theme_ps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ggplot2 theme for proportional symbols — theme_ps","text":"base_size base size base_family base family plot.axes axes shown? plot.legend legend(s) shown?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_add_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: manual legend — tm_add_legend","title":"Map component: manual legend — tm_add_legend","text":"Map component adds manual legend","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_add_legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: manual legend — tm_add_legend","text":"","code":"tm_add_legend( ..., labels, type = \"Symbols\", title = \"\", design = NULL, orientation = NULL, group = NA, group.control = \"check\", resize.as.group = FALSE, z = as.integer(NA) )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_add_legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: manual legend — tm_add_legend","text":"... visual variables arguments passed tm_legend(). default, argument type set \"Symbols\", means supported visual variables : \"fill\", \"col\", \"shape\", \"size\", \"fill_alpha\", \"col_alpha\", \"lty\", \"lwd\", \"linejoin\", \"lineend\". labels labels type layer type visual variables (see ...) taken. Options: \"Symbols\" (default), \"Lines\", \"Polygons\", \"Text\". title text title design legend design orientation legend orientation group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). resize..group resize..group z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: basemap / overlay tiles — tm_basemap","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"Map layer draws tiles tile server. tm_basemap() draws tile layer basemap, .e. bottom layer. contrast, tm_tiles() draws tile layer overlay layer, stacking order corresponds order layer called, just like map layers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"","code":"tm_basemap( server = NULL, alpha = NULL, zoom = NULL, zindex = 0, group = NA, group.control = \"radio\" ) tm_tiles( server = NULL, alpha = NULL, zoom = NULL, zindex = NA, group = NA, group.control = \"check\" )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"server Name provider URL. list available providers can obtained providers (tip: RStudio, type providers$ see options). See https://leaflet-extras.github.io/leaflet-providers/preview/ preview . URL provided, template format, e.g. \"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\". Use NULL tm_basemap() disable basemaps. alpha Transparency level zoom Zoom level (used plot mode) zindex zindex pane view mode. default, set layer number plus 400. default, tmap layers therefore placed custom panes \"tmap401\", \"tmap402\", etc., except base tile layers, placed standard \"tile\". parameter determines name pane z-index, determines pane order bottom top. instance, zindex set 500, pane named \"tmap500\". group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_basemap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"","code":"if (requireNamespace(\"maptiles\")) { tm_basemap() + tm_shape(World) + tm_polygons(\"HPI\") tm_basemap(\"OpenTopoMap\") + tm_shape(World) + tm_polygons(fill = NA, col = \"black\") } #> Loading required namespace: maptiles"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_cartogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: cartogram — tm_cartogram","title":"Map layer: cartogram — tm_cartogram","text":"Map layer draws cartogram","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_cartogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: cartogram — tm_cartogram","text":"","code":"tm_cartogram( size = 1, size.scale = tm_scale(), size.legend = tm_legend_hide(), size.free = NA, plot.order = tm_plot_order(\"size\", reverse = FALSE), trans.args = list(type = \"cont\", itermax = 15), ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_cartogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: cartogram — tm_cartogram","text":"size, size.scale, size.legend, size.free Transformation variable determines size polygons. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args lists passed internal transformation function ... Arguments passed tm_polygons fill,fill.scale,fill.legend,fill.free Visual variable determines fill color. See details. col,col.scale,col.legend,col.free Visual variable determines border color. See details. lwd,lwd.scale,lwd.legend,lwd.free Visual variable determines line width. See details. lty,lty.scale,lty.legend,lty.free Visual variable determines line type. See details. fill_alpha,fill_alpha.scale,fill_alpha.legend,fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha,col_alpha.scale,col_alpha.legend,col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin,lineend Line join line end. See gpar() details. trans.args,mapping.args lists passed internal transformation mapping functions respectively. zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.fill) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_compass.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: compass — tm_compass","title":"Map component: compass — tm_compass","text":"Map component adds compass","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_compass.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: compass — tm_compass","text":"","code":"tm_compass( north, type, text.size, size, show.labels, cardinal.directions, text.color, color.dark, color.light, lwd, position, bg.color, bg.alpha, stack, just, frame, frame.lwd, frame.r, margins, z )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_compass.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: compass — tm_compass","text":"north north type type text.size text.size size size show.labels show.labels cardinal.directions cardinal.directions text.color text.color color.dark color.dark color.light color.light lwd lwd position position bg.color bg.color bg.alpha bg.alpha stack stack just just frame frame frame.lwd frame.lwd frame.r frame.r margins margins z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_const.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap function to define a constant visual value — tm_const","title":"tmap function to define a constant visual value — tm_const","text":"tmap function define constant visual value","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_const.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap function to define a constant visual value — tm_const","text":"","code":"tm_const()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_credits.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: (credits) text — tm_credits","title":"Map component: (credits) text — tm_credits","text":"Map component adds text, typically used credits","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_credits.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: (credits) text — tm_credits","text":"","code":"tm_credits( text, size, color, padding, fontface, fontfamily, stack, just, frame, frame.lwd, frame.r, bg.color, bg.alpha, position, width, height, group.frame, resize.as.group, z )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_credits.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: (credits) text — tm_credits","text":"text text title size font size title color color padding padding fontface font face fontfamily font family stack stack just just frame frame frame.lwd frame.lwd frame.r frame.r bg.color bg.color bg.alpha bg.alpha position position width width height height group.frame group.frame resize..group resize..group z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_extra_innner_margin.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap layout: helper functions — tm_place_legends_right","title":"tmap layout: helper functions — tm_place_legends_right","text":"tmap layout: helper functions","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_extra_innner_margin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap layout: helper functions — tm_place_legends_right","text":"","code":"tm_place_legends_right(width = NA) tm_place_legends_left(width = NA) tm_place_legends_bottom(height = NA) tm_place_legends_top(height = NA) tm_place_legends_inside(pos.h = NULL, pos.v = NULL) tm_extra_innner_margin(left = 0, right = 0, top = 0, bottom = 0)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_extra_innner_margin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"tmap layout: helper functions — tm_place_legends_right","text":"width width height height pos.h, pos.v position (horizontal vertical) left, right, top, bottom extra margins","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_facets.html","id":null,"dir":"Reference","previous_headings":"","what":"Facets — tm_facets","title":"Facets — tm_facets","text":"Specify facets. tm_facets() core function, recommended use tm_facets_wrap(), tm_facets_stack() tm_facets_grid(). former two specify facets one grouping variable (one faceting dimension). difference wrap may place facets multiple rows columns whereas tm_facets_stack() stacks facets either horizontally vertically. tm_facets_grid() supports three faceting dimensions.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_facets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Facets — tm_facets","text":"","code":"tm_facets( by = NULL, rows = NULL, columns = NULL, pages = NULL, as.layers = FALSE, nrows = NA, ncols = NA, byrow = TRUE, orientation = NA, free.coords = NA, drop.units = TRUE, drop.empty.facets = TRUE, drop.NA.facets = FALSE, sync = TRUE, showNA = NA, textNA = \"Mssing\", scale.factor = 2, type = NA, along = NULL ) tm_facets_grid(rows = NULL, columns = NULL, pages = NULL, ...) tm_facets_wrap(by = \"VARS__\", nrows = NA, ncols = NA, byrow = TRUE, ...) tm_facets_pagewise(by = \"VARS__\", nrows = 1, ncols = 1, byrow = TRUE, ...) tm_facets_stack(by = \"VARS__\", orientation = NA, ...) tm_facets_hstack(by = \"VARS__\", ...) tm_facets_vstack(by = \"VARS__\", ...) tm_facets_flip()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_facets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Facets — tm_facets","text":"Group variable (facet wrap facet stack) rows Variable specifies rows (facet grid) columns Variable specifies columns (facet grid) pages Variable specifies pages (facet grid) .layers show facets layers? nrows Number rows ncols Number columns byrow facets wrapped row? orientation facet stack: horizontal vertical? free.coords Logical. argument specified, map coordinate ranges? default TRUE, unless facets shown different layers (.layers = TRUE) drop.units Logical. argument specified, non-selected spatial units dropped? FALSE, plotted mapped aesthetics regarded missing values. applicable raster shapes. default TRUE. drop.empty.facets Logical. argument specified, empty facets dropped? Empty facets occur -variable contains unused levels. TRUE two -variables specified, empty rows columns dropped. drop.NA.facets Logical. argument specified, data values specific facets missing, facets dropped? FALSE default. sync Logical. navigation view mode (zooming panning) synchronized? default TRUE facets bounding box. generally case rasters plotted, free.coords FALSE. showNA argument specified, missing values -variable shown facet? two -variables specified, missing values shown additional row column? NA, missing values shown exist. Similar useNA argument table(), TRUE, FALSE, NA correspond \"always\", \"\", \"ifany\" respectively. textNA Text used facets missing values. scale.factor Number determines elements (e.g. font sizes, symbol sizes, line widths) small multiples scaled relation scaling factor shapes. elements scaled scale.factorth root scaling factor shapes. , scale.factor=1, scaled proportional scaling shapes. Since elements, especially text, often small read, higher value recommended. default, scale.factor=2. type \"grid\", \"wrap\" \"stack\" along deprecated Please use tm_facets_page() ... passed tm_facets()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":null,"dir":"Reference","previous_headings":"","what":"Coordinate grid / graticule lines — tm_graticules","title":"Coordinate grid / graticule lines — tm_graticules","text":"Creates tmap-element draws coordinate grid lines. serves layer can drawn anywhere layers. default, tm_grid() draws horizontal vertical lines according coordinate system (master) shape object. Latitude longitude graticules drawn tm_graticules().","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coordinate grid / graticule lines — tm_graticules","text":"","code":"tm_graticules( x = NA, y = NA, n.x = NA, n.y = NA, crs = 4326, labels.format = list(suffix = intToUtf8(176)), labels.cardinal = TRUE, ... ) tm_grid( x = NA, y = NA, n.x = NA, n.y = NA, crs = NA, col = NA, lwd = 1, alpha = NA, labels.show = TRUE, labels.pos = c(\"left\", \"bottom\"), labels.size = 0.6, labels.col = NA, labels.rot = c(0, 0), labels.format = list(big.mark = \",\"), labels.cardinal = FALSE, labels.margin.x = 0, labels.margin.y = 0, labels.space.x = NA, labels.space.y = NA, labels.inside.frame = FALSE, ticks = labels.show & !labels.inside.frame, lines = TRUE, ndiscr = 100, zindex = NA, group = NA, group.control = \"none\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coordinate grid / graticule lines — tm_graticules","text":"x X coordinates vertical grid lines. NA, specified pretty scale n.x. y Y coordinates horizontal grid lines. NA, specified pretty scale n.y. n.x Preferred number grid lines x axis. labels, pretty() sequence used, number actual labels may different n.x. n.y Preferred number grid lines y axis. labels, pretty() sequence used, number actual labels may different n.y. crs Projection character. specified, grid lines projected accordingly. Many world maps projected, still latitude longitude (EPSG 4326) grid lines. labels.format List formatting options grid labels. Parameters : fun Function specify labels. take numeric vector, return character vector size. default specified. specified, list items scientific, format, digits (see ) used. scientific labels formatted scientifically? , square brackets used, format numbers \"g\". Otherwise, format=\"f\", text.separator, text.less., text..used. Also, numbers automatically rounded millions billions applicable. format default, \"f\", .e. standard notation xxx.xxx, used. scientific=TRUE \"g\", means numbers formatted scientifically, .e. n.dddE+nn needed save space. digits Number digits decimal point format=\"f\", number significant digits otherwise. ... arguments passed formatC() labels.cardinal Add four cardinal directions (N, E, S, W) labels, instead using negative coordinates west south (assumes coordinates positive north-east direction). ... Arguments passed tm_grid() col Color grid lines. lwd Line width grid lines alpha Alpha transparency grid lines. Number 0 1. default, alpha transparency col taken. labels.show Show tick labels. Either one value x y axis, vector two: first x latter y. labels.pos position labels. Vector two: horizontal (\"left\" \"right\") vertical (\"top\" \"bottom\") position. labels.size Font size tick labels labels.col Font color tick labels labels.rot Rotation angles labels. Vector two values: first rotation angle (degrees) tick labels x axis second rotation angle tick labels y axis. 0, 90, 180, 270 valid values. labels.margin.x Margin tick labels x axis frame. Note labels.inside.frame == FALSE ticks == TRUE, ticks adjusted accordingly. labels.margin.y Margin tick labels y axis frame. Note labels.inside.frame == FALSE ticks == TRUE, ticks adjusted accordingly. labels.space.x Space used labels ticks x-axis labels.inside.frame == FALSE. default, determined automatically using widths heights tick labels. unit parameter text line height. labels.space.y Space used labels ticks y-axis labels.inside.frame == FALSE. default, determined automatically using widths heights tick labels. unit parameter text line height. labels.inside.frame Show labels inside frame? default FALSE. ticks labels.inside.frame = FALSE, ticks can drawn labels frame? Either one value x y axis, vector two: first x latter y. lines labels.inside.frame = FALSE, grid lines can drawn? ndiscr Number points discretize parallel meridian (applicable curved grid lines) zindex zindex pane view mode. default, set layer number plus 400. default, tmap layers therefore placed custom panes \"tmap401\", \"tmap402\", etc., except base tile layers, placed standard \"tile\". parameter determines name pane z-index, determines pane order bottom top. instance, zindex set 500, pane named \"tmap500\". group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_grid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coordinate grid / graticule lines — tm_graticules","text":"","code":"current.mode <- tmap_mode(\"plot\") #> tmap mode set to 'plot' tm_shape(NLD_muni) + tm_polygons() + tm_grid() tm_shape(NLD_muni) + tm_polygons() + tm_grid(crs = 4326) tm_shape(NLD_muni) + tm_polygons() + tm_grid(crs = 3035, labels.inside.frame = TRUE) tm_shape(World) + tm_polygons() + tm_facets(by = \"continent\") + tm_grid(labels.inside.frame = TRUE) tm_shape(NLD_muni) + tm_polygons() + tm_graticules() tm_shape(NLD_muni) + tm_polygons() + tm_graticules(labels.pos = c(\"right\", \"top\")) data(NLD_muni, World) tmap_arrange( qtm(NLD_muni, borders = NULL) + tm_grid(), qtm(NLD_muni, borders = NULL) + tm_graticules() ) qtm(World, shape.crs = \"+proj=robin\", style = \"natural\") + tm_graticules(ticks = FALSE) + tm_layout(frame=FALSE) tmap_mode(current.mode) #> tmap mode set to 'plot'"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":null,"dir":"Reference","previous_headings":"","what":"Layout options — tm_layout","title":"Layout options — tm_layout","text":"Set tmap options directly related layout.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Layout options — tm_layout","text":"","code":"tm_layout( modes, crs, facet.max, facet.flip, raster.max.cells, show.messages, show.warnings, output.format, output.size, output.dpi, output.dpi.animation, value.const, value.na, value.null, value.blank, values.var, values.range, value.neutral, scales.var, scale.misc.args, label.format, label.na, scale, asp, bg.color, outer.bg.color, frame, frame.lwd, frame.r, frame.double.line, outer.margins, inner.margins, inner.margins.extra, meta.margins, meta.auto.margins, between.margin, component.offset, component.stack.margin, grid.mark.height, xylab.height, coords.height, xlab.show, xlab.text, xlab.size, xlab.color, xlab.rotation, xlab.space, xlab.fontface, xlab.fontfamily, xlab.side, ylab.show, ylab.text, ylab.size, ylab.color, ylab.rotation, ylab.space, ylab.fontface, ylab.fontfamily, ylab.side, panel.type, panel.wrap.pos, panel.xtab.pos, unit, color.sepia.intensity, color.saturation, color.vision.deficiency.sim, text.fontface, text.fontfamily, legend.show, legend.design, legend.orientation, legend.position, legend.width, legend.height, legend.stack, legend.group.frame, legend.resize.as.group, legend.reverse, legend.na.show, legend.title.color, legend.title.size, legend.title.fontface, legend.title.fontfamily, legend.xlab.color, legend.xlab.size, legend.xlab.fontface, legend.xlab.fontfamily, legend.ylab.color, legend.ylab.size, legend.ylab.fontface, legend.ylab.fontfamily, legend.text.color, legend.text.size, legend.text.fontface, legend.text.fontfamily, legend.frame, legend.frame.lwd, legend.frame.r, legend.bg.color, legend.bg.alpha, legend.settings.standard.portrait, legend.settings.standard.landscape, title.show, title.size, title.color, title.fontface, title.fontfamily, title.bg.color, title.bg.alpha, title.padding, title.frame, title.frame.lwd, title.frame.r, title.stack, title.position, title.group.frame, title.resize.as.group, credits.show, credits.size, credits.color, credits.fontface, credits.fontfamily, credits.bg.color, credits.bg.alpha, credits.padding, credits.frame, credits.frame.lwd, credits.frame.r, credits.stack, credits.position, credits.width, credits.heigth, credits.group.frame, credits.resize.as.group, compass.north, compass.type, compass.text.size, compass.size, compass.show.labels, compass.cardinal.directions, compass.text.color, compass.color.dark, compass.color.light, compass.lwd, compass.bg.color, compass.bg.alpha, compass.margins, compass.show, compass.stack, compass.position, compass.frame, compass.frame.lwd, compass.frame.r, compass.group.frame, compass.resize.as.group, scalebar.show, scalebar.breaks, scalebar.width, scalebar.text.size, scalebar.text.color, scalebar.color.dark, scalebar.color.light, scalebar.lwd, scalebar.position, scalebar.bg.color, scalebar.bg.alpha, scalebar.size, scalebar.margins, scalebar.stack, scalebar.frame, scalebar.frame.lwd, scalebar.frame.r, scalebar.group.frame, scalebar.resize.as.group, grid.show, grid.labels.pos, grid.x, grid.y, grid.n.x, grid.n.y, grid.crs, grid.col, grid.lwd, grid.alpha, grid.labels.show, grid.labels.size, grid.labels.col, grid.labels.rot, grid.labels.format, grid.labels.cardinal, grid.labels.margin.x, grid.labels.margin.y, grid.labels.space.x, grid.labels.space.y, grid.labels.inside.frame, grid.ticks, grid.lines, grid.ndiscr, mouse_coordinates.stack, mouse_coordinates.position, mouse_coordinates.show, panel.show, panel.labels, panel.label.size, panel.label.color, panel.label.fontface, panel.label.fontfamily, panel.label.bg.color, panel.label.height, panel.label.rot, qtm.scalebar, qtm.minimap, qtm.mouse.coordinates, earth.boundary, earth.boundary.color, earth.boundary.lwd, earth.datum, space.color, attr.color, max.categories, legend.hist.bg.color, legend.hist.bg.alpha, legend.hist.size, legend.hist.height, legend.hist.width, attr.outside, attr.outside.position, attr.outside.size, attr.position, attr.just, basemap.server, basemap.alpha, basemap.zoom, overlays, overlays.alpha, alpha, colorNA, symbol.size.fixed, dot.size.fixed, text.size.variable, bbox, check.and.fix, set.bounds, set.view, set.zoom.limits, name, basemap.show, title = NULL, main.title = NULL, ... ) tm_style(style, ...) tm_format(format, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Layout options — tm_layout","text":"modes, crs, facet.max, facet.flip, raster.max.cells, show.messages, show.warnings, output.format, output.size, output.dpi, output.dpi.animation, value.const, value.na, value.null, value.blank, values.var, values.range, value.neutral, scales.var, scale.misc.args, label.format, label.na, scale, asp, bg.color, outer.bg.color, frame, frame.lwd, frame.r, frame.double.line, outer.margins, inner.margins, inner.margins.extra, meta.margins, meta.auto.margins, .margin, component.offset, component.stack.margin, grid.mark.height, xylab.height, coords.height, xlab.show, xlab.text, xlab.size, xlab.color, xlab.rotation, xlab.space, xlab.fontface, xlab.fontfamily, xlab.side, ylab.show, ylab.text, ylab.size, ylab.color, ylab.rotation, ylab.space, ylab.fontface, ylab.fontfamily, ylab.side, panel.type, panel.wrap.pos, panel.xtab.pos, unit, color.sepia.intensity, color.saturation, color.vision.deficiency.sim, text.fontface, text.fontfamily, legend.show, legend.design, legend.orientation, legend.position, legend.width, legend.height, legend.stack, legend.group.frame, legend.resize..group, legend.reverse, legend.na.show, legend.title.color, legend.title.size, legend.title.fontface, legend.title.fontfamily, legend.xlab.color, legend.xlab.size, legend.xlab.fontface, legend.xlab.fontfamily, legend.ylab.color, legend.ylab.size, legend.ylab.fontface, legend.ylab.fontfamily, legend.text.color, legend.text.size, legend.text.fontface, legend.text.fontfamily, legend.frame, legend.frame.lwd, legend.frame.r, legend.bg.color, legend.bg.alpha, legend.settings.standard.portrait, legend.settings.standard.landscape, title.show, title.size, title.color, title.fontface, title.fontfamily, title.bg.color, title.bg.alpha, title.padding, title.frame, title.frame.lwd, title.frame.r, title.stack, title.position, title.group.frame, title.resize..group, credits.show, credits.size, credits.color, credits.fontface, credits.fontfamily, credits.bg.color, credits.bg.alpha, credits.padding, credits.frame, credits.frame.lwd, credits.frame.r, credits.stack, credits.position, credits.width, credits.heigth, credits.group.frame, credits.resize..group, compass.north, compass.type, compass.text.size, compass.size, compass.show.labels, compass.cardinal.directions, compass.text.color, compass.color.dark, compass.color.light, compass.lwd, compass.bg.color, compass.bg.alpha, compass.margins, compass.show, compass.stack, compass.position, compass.frame, compass.frame.lwd, compass.frame.r, compass.group.frame, compass.resize..group, scalebar.show, scalebar.breaks, scalebar.width, scalebar.text.size, scalebar.text.color, scalebar.color.dark, scalebar.color.light, scalebar.lwd, scalebar.position, scalebar.bg.color, scalebar.bg.alpha, scalebar.size, scalebar.margins, scalebar.stack, scalebar.frame, scalebar.frame.lwd, scalebar.frame.r, scalebar.group.frame, scalebar.resize..group, grid.show, grid.labels.pos, grid.x, grid.y, grid.n.x, grid.n.y, grid.crs, grid.col, grid.lwd, grid.alpha, grid.labels.show, grid.labels.size, grid.labels.col, grid.labels.rot, grid.labels.format, grid.labels.cardinal, grid.labels.margin.x, grid.labels.margin.y, grid.labels.space.x, grid.labels.space.y, grid.labels.inside.frame, grid.ticks, grid.lines, grid.ndiscr, mouse_coordinates.stack, mouse_coordinates.position, mouse_coordinates.show, panel.show, panel.labels, panel.label.size, panel.label.color, panel.label.fontface, panel.label.fontfamily, panel.label.bg.color, panel.label.height, panel.label.rot, qtm.scalebar, qtm.minimap, qtm.mouse.coordinates, earth.boundary, earth.boundary.color, earth.boundary.lwd, earth.datum, space.color, attr.color, max.categories, legend.hist.bg.color, legend.hist.bg.alpha, legend.hist.size, legend.hist.height, legend.hist.width, attr.outside, attr.outside.position, attr.outside.size, attr.position, attr.just, basemap.server, basemap.alpha, basemap.zoom, overlays, overlays.alpha, alpha, colorNA, symbol.size.fixed, dot.size.fixed, text.size.variable, bbox, check..fix, set.bounds, set.view, set.zoom.limits, name, basemap.show See tmap_options() title, main.title deprecated ... used catch deprecated arguments style name style format name format","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_layout.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Layout options — tm_layout","text":"","code":"data(land, World) # Error unable to warp stars (argument not yet added to tm_shape) # On Windows if (FALSE) { tm_shape(land, raster.wrap = FALSE) + tm_raster( \"elevation\", col.scale = tm_scale_intervals( breaks = c(-Inf, 250, 500, 1000, 1500, 2000, 2500, 3000, 4000, Inf), values = terrain.colors(9), midpoint = NA ), col.legend = tm_legend( title = \"Elevation\", position = tm_pos_in(\"left\", \"bottom\"), frame = TRUE, bg.color = \"lightblue\" ) ) + tm_shape(World, is.main = TRUE, crs = \"+proj=eck4\") + tm_borders(\"grey20\") + tm_graticules(labels.size = .5) + tm_text(\"name\", size = \"AREA\") + # tm_compass(position = c(.65, .15), color.light = \"grey90\") + # tm_credits(\"Eckert IV projection\", position = c(\"right\", \"BOTTOM\")) + tm_style(\"classic_v3\") + tm_layout(bg.color = \"lightblue\", inner.margins = c(0, 0, .02, 0)) } data(land, World) tm_shape(World) + tm_fill(\"pop_est_dens\", fill.scale = tm_scale_intervals(style = \"kmeans\"), fill.legend = tm_legend(title = \"Population density\")) + tm_style(\"albatross_v3\", frame.lwd = 10) + tm_format(\"World\") + tm_title(\"The World\", position = tm_pos_in(\"left\", \"top\")) ################################ # not working yet: ################################ if (FALSE) { tm_shape(land) + tm_raster(\"elevation\", breaks=c(-Inf, 250, 500, 1000, 1500, 2000, 2500, 3000, 4000, Inf), palette = terrain.colors(9), title=\"Elevation\", midpoint = NA) + tm_shape(World, is.master=TRUE, projection = \"+proj=eck4\") + tm_borders(\"grey20\") + tm_graticules(labels.size = .5) + tm_text(\"name\", size=\"AREA\") + tm_compass(position = c(.65, .15), color.light = \"grey90\") + tm_credits(\"Eckert IV projection\", position = c(\"right\", \"BOTTOM\")) + tm_style(\"classic\") + tm_layout(bg.color=\"lightblue\", inner.margins=c(.04,.03, .02, .01), earth.boundary = TRUE, space.color=\"grey90\") + tm_legend(position = c(\"left\", \"bottom\"), frame = TRUE, bg.color=\"lightblue\") } tm_shape(World, projection=\"+proj=robin\") + tm_polygons(\"HPI\", palette=\"div\", n=7, title = \"Happy Planet Index\") + tm_credits(\"Robinson projection\", position = c(\"right\", \"BOTTOM\")) + tm_style(\"natural\", earth.boundary = c(-180, -87, 180, 87), inner.margins = .05) + tm_legend(position=c(\"left\", \"bottom\"), bg.color=\"grey95\", frame=TRUE) #> Warning: The 'projection' argument of 'tm_shape()' is deprecated as of tmap 4.0. Pleaes use 'crs' instead. #> Deprecated tmap v3 code detected. Code translated to v4 #> Warning: v3 code detected: as of tmap v4, tm_legend should be specified per visual variable (e.g. with the argument fill.legend of tm_polygons # Not working yet if (FALSE) { # Example to illustrate the type of titles tm_shape(World) + tm_polygons(c(\"income_grp\", \"economy\"), title = c(\"Legend Title 1\", \"Legend Title 2\")) + tm_layout(main.title = \"Main Title\", main.title.position = \"center\", main.title.color = \"blue\", title = c(\"Title 1\", \"Title 2\"), title.color = \"red\", panel.labels = c(\"Panel Label 1\", \"Panel Label 2\"), panel.label.color = \"purple\", legend.text.color = \"brown\") } if (FALSE) { # global option tmap.style demo # get current style current.style <- tmap_style() qtm(World, fill = \"economy\", format = \"World\") tmap_style(\"col_blind\") qtm(World, fill = \"economy\", format = \"World\") tmap_style(\"cobalt\") qtm(World, fill = \"economy\", format = \"World\") # set to current style tmap_style(current.style) } # TIP: check out these examples in view mode, enabled with tmap_mode(\"view\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Legend — tm_legend","title":"Legend — tm_legend","text":"Legend specification","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Legend — tm_legend","text":"","code":"tm_legend( title, show, orientation, design, reverse, na.show, position, width, height, stack, z, group.frame, resize.as.group, title.color, title.size, title.fontface, title.fontfamily, title.padding, text.color, text.size, text.fontface, text.fontfamily, format, frame, frame.lwd, frame.r, bg.color, bg.alpha, item.height, item.width, item.space, item.na.height, item.na.width, item.na.space, item.shape, ticks, ticks.disable.na, ticks.col, ticks.lwd, title.align, margins, margin.item.text, ... ) tm_legend_hide() tm_legend_combine(variable)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Legend — tm_legend","text":"title PARAM_DESCRIPTION show PARAM_DESCRIPTION orientation PARAM_DESCRIPTION design PARAM_DESCRIPTION reverse PARAM_DESCRIPTION na.show PARAM_DESCRIPTION position PARAM_DESCRIPTION width PARAM_DESCRIPTION height PARAM_DESCRIPTION stack PARAM_DESCRIPTION z PARAM_DESCRIPTION group.frame PARAM_DESCRIPTION resize..group PARAM_DESCRIPTION title.color PARAM_DESCRIPTION title.size PARAM_DESCRIPTION title.fontface PARAM_DESCRIPTION title.fontfamily PARAM_DESCRIPTION title.padding PARAM_DESCRIPTION text.color PARAM_DESCRIPTION text.size PARAM_DESCRIPTION text.fontface PARAM_DESCRIPTION text.fontfamily PARAM_DESCRIPTION format PARAM_DESCRIPTION frame PARAM_DESCRIPTION frame.lwd PARAM_DESCRIPTION frame.r PARAM_DESCRIPTION bg.color PARAM_DESCRIPTION bg.alpha PARAM_DESCRIPTION item.height PARAM_DESCRIPTION item.width PARAM_DESCRIPTION item.space PARAM_DESCRIPTION item.na.height PARAM_DESCRIPTION item.na.width PARAM_DESCRIPTION item.na.space PARAM_DESCRIPTION item.shape PARAM_DESCRIPTION ticks PARAM_DESCRIPTION ticks.disable.na PARAM_DESCRIPTION ticks.col PARAM_DESCRIPTION ticks.lwd PARAM_DESCRIPTION title.align PARAM_DESCRIPTION margins PARAM_DESCRIPTION margin.item.text PARAM_DESCRIPTION ... passed (?) variable visual (transformation) variable combine legend : e.g. \"fill\" \"size\"","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Legend — tm_legend","text":"OUTPUT_DESCRIPTION","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: lines — tm_lines","title":"Map layer: lines — tm_lines","text":"Map layer draws symbols Supported visual variables : col (color), lwd (line width), lty (line type), col_alpha (color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: lines — tm_lines","text":"","code":"tm_lines( col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, linejoin = \"round\", lineend = \"round\", plot.order = tm_plot_order(\"LENGTH\", reverse = FALSE, na.order = \"bottom\"), trans.args = list(lines.only = \"ifany\"), mapping.args = list(), zindex = NA, group = NA, group.control = \"check\", popup.vars = NA, popup.format = list(), hover = \"\", id = \"\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: lines — tm_lines","text":"col, col.scale, col.legend, col.free Visual variable determines col color. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin, lineend line join line end. See gpar() details. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.col) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode. ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: lines — tm_lines","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_lines.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: lines — tm_lines","text":"","code":"data(rivers) tm_shape(rivers) + tm_lines() tm_shape(rivers) + tm_lines(lwd = \"scalerank\") tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lwd.scale = tm_scale_continuous(values.scale = 2, n = 20), lwd.legend = tm_legend(orientation = \"landscape\", item.width = 2), col = \"type\", col.scale = tm_scale(values = c(\"darkblue\", \"darkred\"))) tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lty = \"scalerank\", col = \"scalerank\", col.scale = tm_scale_categorical(), lty.legend = tm_legend_combine(\"lwd\"), col.legend = tm_legend_combine(\"lwd\")) ### tmap3 tm_shape(World) + tm_fill() + tm_shape(rivers) + tm_lines(col=\"black\", lwd=\"scalerank\", scale=2, legend.lwd.show = FALSE) + tm_style(\"cobalt\", title = \"Rivers of the World\") + tm_format(\"World\") #> Deprecated tmap v3 code detected. Code translated to v4"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mouse_coordinates.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: mouse coordinates — tm_mouse_coordinates","title":"Map component: mouse coordinates — tm_mouse_coordinates","text":"Map component adds mouse coordinates","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mouse_coordinates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: mouse coordinates — tm_mouse_coordinates","text":"","code":"tm_mouse_coordinates(stack, position, z)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mouse_coordinates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: mouse coordinates — tm_mouse_coordinates","text":"stack stack position position z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv.html","id":null,"dir":"Reference","previous_headings":"","what":"define multivariate variable — tm_mv","title":"define multivariate variable — tm_mv","text":"define multivariate variable","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"define multivariate variable — tm_mv","text":"","code":"tm_mv(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"define multivariate variable — tm_mv","text":"... variable names","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv_dim.html","id":null,"dir":"Reference","previous_headings":"","what":"define multivariate variable based on stars dimension — tm_mv_dim","title":"define multivariate variable based on stars dimension — tm_mv_dim","text":"define multivariate variable based stars dimension","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv_dim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"define multivariate variable based on stars dimension — tm_mv_dim","text":"","code":"tm_mv_dim(x, values)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_mv_dim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"define multivariate variable based on stars dimension — tm_mv_dim","text":"x dimension name values values used","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot mode options — tm_plot","title":"Plot mode options — tm_plot","text":"Plot mode options. option specific plot mode.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot mode options — tm_plot","text":"","code":"tm_plot(use.gradient)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot mode options — tm_plot","text":"use.gradient Use gradient fill using linearGradient()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot_order.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine plotting order of features — tm_plot_order","title":"Determine plotting order of features — tm_plot_order","text":"Determine plotting order features.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot_order.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine plotting order of features — tm_plot_order","text":"","code":"tm_plot_order( aes, reverse = TRUE, na.order = c(\"mix\", \"bottom\", \"top\"), null.order = c(\"bottom\", \"mix\", \"top\"), null.below.na = TRUE )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_plot_order.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine plotting order of features — tm_plot_order","text":"aes Visual variable values determine plotting order. Example: bubble map \"size\" aesthetic used. data variable (say population) mapped via continuous scale (tm_scale_continuous()) bubble sizes. bubbles plotted order size. determined arguments. Use \"DATA\" keep order data. Another special value \"AREA\" \"LENGTH\" preserved polygons lines respectively: rather data variable polygon area / line lengths determines plotting order. reverse Logical determines whether visual values plotted reversed order. visual values (specified tmap option \"values.var\") default reversed, plotted starting last value. bubble map example, means large bubbles plotted first, hence bottom. na.order features plotted NA value (least) one aesthetic variable? (order) \"mix\", \"bottom\", \"top\"? bubble map example: fill color missing bubble, bubbles plotted? null.order non-selected (aka null) features plotted? null..na null features plotted NA features?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: polygons — tm_polygons","title":"Map layer: polygons — tm_polygons","text":"Map layer draws polygons. Supported visual variables : fill (fill color), col (border color), lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) col_alpha (border color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: polygons — tm_polygons","text":"","code":"tm_polygons( fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, linejoin = \"round\", lineend = \"round\", plot.order = tm_plot_order(\"AREA\", reverse = FALSE, na.order = \"bottom\"), trans.args = list(polygons.only = \"ifany\"), mapping.args = list(), zindex = NA, group = NA, group.control = \"check\", popup.vars = NA, popup.format = list(), hover = \"\", id = \"\", ... ) tm_fill(...) tm_borders(col = tm_const(), ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: polygons — tm_polygons","text":"fill, fill.scale, fill.legend, fill.free Visual variable determines fill color. See details. col, col.scale, col.legend, col.free Visual variable determines border color. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin, lineend Line join line end. See gpar() details. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively. zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.fill) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode. ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: polygons — tm_polygons","text":"visual variable arguments (e.g. col) can specified either data variable name (e.g., spatial vector attribute raster layer object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). *.scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_*() functions. default specified tmap option (tm_options()) scales.var. *.legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options (tm_options()) legend. . *.free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, *.free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_polygons.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: polygons — tm_polygons","text":"","code":"# load Africa country data data(World) Africa = World[World$continent == \"Africa\", ] Africa_border = sf::st_make_valid(sf::st_union(sf::st_buffer(Africa, 0.001))) # slow and ugly # without specifications tm_shape(Africa_border) + tm_polygons() tm_shape(Africa_border) + tm_fill() tm_shape(Africa_border) + tm_borders() # specification with visual variable values tm_shape(Africa) + tm_polygons(fill = \"limegreen\", col = \"purple\", lwd = 3, lty = \"solid\", col_alpha = 0.3) + tm_shape(Africa_border) + tm_borders(\"darkred\", lwd = 4) # specification with a data variable tm_shape(Africa) + tm_polygons(fill = \"income_grp\", fill.scale = tm_scale_categorical(values = \"tol.muted\")) # continuous color scale with landscape legend tm_shape(Africa) + tm_polygons(fill = \"inequality\", fill.scale = tm_scale_continuous(values = \"kovesi.rainbow_bu_pk\"), fill.legend = tm_legend( title = \"\", orientation = \"landscape\", position = tm_pos_out(\"center\", \"bottom\"), frame = FALSE )) + tm_title(\"Inequality index\", position = tm_pos_in(\"right\", \"TOP\"), frame = FALSE) + tm_layout(frame = FALSE) #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). tm_shape(World) + tm_polygons(tm_mv(\"inequality\", \"well_being\")) #> Labels abbreviated by the first letters, e.g.: \"2 to 3\" => \"2\" #################################### ########## v3 ###################### #################################### tmap_style(\"v3\") #> tmap style set to \"v3\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" data(World) # Constant fill tm_shape(World) + tm_fill(\"darkolivegreen3\") + tm_format(\"World\", title=\"A green World\") #> Warning: The 'title' argument of 'tm_format()' is deprecated as of tmap 4.0. Please use 'tm_title()' instead. # Borders only tm_shape(World) + tm_borders() # Data variable containing color values World$isNLD = ifelse(World$name==\"Netherlands\", \"darkorange\", \"darkolivegreen3\") tm_shape(World) + tm_fill(\"isNLD\") + tm_layout(\"Find the Netherlands!\") tm_shape(World, projection = \"+proj=eck4\") + tm_polygons(\"economy\", title=\"Economy\", id=\"name\") + tm_text(\"iso_a3\", size=\"AREA\", scale=1.5) + tm_format(\"World\") #> Warning: The 'projection' argument of 'tm_shape()' is deprecated as of tmap 4.0. Pleaes use 'crs' instead. #> Deprecated tmap v3 code detected. Code translated to v4 #> Deprecated tmap v3 code detected. Code translated to v4 # Numeric data variable tm_shape(World, projection = \"+proj=eck4\") + tm_polygons(\"HPI\", palette=\"RdYlGn\", style=\"cont\", n=8, title=\"Happy Planet Index\", id=\"name\") + tm_text(\"iso_a3\", size=\"AREA\", scale=1.5) + tm_style(\"grey\") + tm_format(\"World\") #> Warning: The 'projection' argument of 'tm_shape()' is deprecated as of tmap 4.0. Pleaes use 'crs' instead. #> Deprecated tmap v3 code detected. Code translated to v4 #> Deprecated tmap v3 code detected. Code translated to v4 if (FALSE) { data(NLD_prov, NLD_muni) # Map coloring algorithm tm_shape(NLD_prov) + tm_fill(\"name\", legend.show = FALSE) + tm_shape(NLD_muni) + tm_polygons(\"MAP_COLORS\", palette=\"Greys\", alpha = .25) + tm_shape(NLD_prov) + tm_borders(lwd=2) + tm_text(I(\"name\"), col = \"white\", shadow=TRUE) + tm_format(\"NLD\", title=\"Dutch provinces and\\nmunicipalities\", bg.color=\"white\") # Cartogram if (require(cartogram)) { NLD_prov_pop <- cartogram(NLD_prov, \"population\") tm_shape(NLD_prov_pop) + tm_polygons(\"origin_non_west\", title = \"Non-western origin (%)\") } } # TIP: check out these examples in view mode, enabled with tmap_mode(\"view\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the position of map components — tm_pos","title":"Set the position of map components — tm_pos","text":"Set position map components, legends, title, compass, scale bar, etc. tm_pos() function position components: tm_pos_out() places components outside map area tm_pos_in() inside map area. position argument map layer component specified one functions. functions tm_pos_auto_out() tm_pos_auto_in() used set components automatically, recommended use globally, via tmap_options(). See Details positioning works.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the position of map components — tm_pos","text":"","code":"tm_pos(cell.h, cell.v, pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_in(pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_out(cell.h, cell.v, pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_auto_out(cell.h, cell.v, pos.h, pos.v, align.h, align.v, just.h, just.v) tm_pos_auto_in(align.h, align.v, just.h, just.v)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the position of map components — tm_pos","text":"cell.h, cell.v plotting area overlaid 3x3 grid, middle grid cell map area. Components can drawn cell. cell.h specifies horizontal position (column) can take values \"left\", \"center\", \"right\". cell.v specifies vertical position (row) can take values \"top\", \"center\", \"bottom\". See details graphical explanation. pos.h, pos.v position component within cell. main options pos.h \"left\", \"center\", \"right\". cell.v \"top\", \"center\", \"bottom\". options can also provided upper case; case offset (see tmap option component.offset). Also numbers 0 1 can provided, determine position component inside cell ((0,0) left bottom). arguments just.h just.v determine justification point. align.h, align.v alignment component case multiple components stacked. stacked horizontally, align.v determines components smaller height available height (determined outer.margins specified otherwise highest component) justified: \"top\", \"center\", \"bottom\". Similarly, align.h determines components justified horizontally stacked vertically: \"left\", \"center\", \"right\". just.h, just.v justification components. used case pos.h pos.v numbers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_pos.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set the position of map components — tm_pos","text":"tm_pos_in() sets position component(s) inside maps area, equivalent center-center cell (case facets, drawn center-center cell). tm_pos_out() sets position component(s) outside map. amount space top bottom rows, left right columns occupy determined tm_layout() arguments meta.margins meta.auto.margins. former sets relative space bottom, left, top, right side. case set NA, space set automatically based 1) maximum relative space specified meta.auto.margins 2) presence size components cell. instance, one landscape oriented legend center-bottom cell, relative space bottom row set height legend (given smaller corresponding value meta.auto.margins), four sides set 0. tm_pos_auto_out() complex: cell.h cell.v arguments set one four corners. mean components drawn corner. corner represents sides map components drawn. default, legends drawn either bottom right-side map default (see tmap_options(\"legend.position\")). row- column-wise legends general legend (using tm_facets_grid()), general legend drawn corner, practice case rare. arguments pos.h pos.v determine components drawn within cell. , \"left\", \"center\", \"right\" pos.h \"top\", \"center\", \"bottom\" pos.v. values can also specified upper-case, influences offset cell borders, determined tmap option component.offset. default, small offset components drawn inside offset drawn outside upper-case. tm_pos_auto_in() automatically determines pos.h pos.v given available space inside map. similar default positioning tmap3. case multiple components draw cell position inside cell, stacked (determined stack argument legend component function). align.h align.v arguments determine components justified . Note legends components may different facet row column. case tm_facets_grid() tm_facets_stack() applied scales set free (.free argument map layer functions). case legends components draw row- column wise, position legends (components) right next maps, legends (components) aligned maps.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: raster — tm_raster","title":"Map layer: raster — tm_raster","text":"Map layer draws rasters. Supported visual variable : col ( color).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: raster — tm_raster","text":"","code":"tm_raster( col = tm_shape_vars(), col.scale = tm_scale(value.na = \"#00000000\"), col.legend = tm_legend(), col.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, trans.args = list(), mapping.args = list(), zindex = NA, group = NA, group.control = \"check\" )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: raster — tm_raster","text":"col, col.scale, col.legend, col.free Visual variable determines color. See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines alpha transparency. See details. trans.args, mapping.args lists passed internal transformation mapping functions respectively. zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: raster — tm_raster","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_() functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()), one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_raster.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: raster — tm_raster","text":"","code":"# load land data data(land, World) tm_shape(land) + tm_raster() + tm_facets_hstack() #> stars object downsampled to 540 by 270 cells. #> Variable(s) \"col\" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette. #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). tm_shape(land) + tm_raster(\"elevation\", col.scale = tm_scale_continuous(values = terrain.colors(9))) + tm_shape(World) + tm_borders()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_rgb.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: RGB — tm_rgb","title":"Map layer: RGB — tm_rgb","text":"Map layer: RGB","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_rgb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: RGB — tm_rgb","text":"","code":"tm_rgb( col = tm_mv(1:3), col.scale = tm_scale_rgb(), col.legend = tm_legend(), col.free = NA )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_rgb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: RGB — tm_rgb","text":"col, col.scale, col.legend, col.free Visual variable determines col color.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: automatic scale — tm_scale","title":"Scales: automatic scale — tm_scale","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale() scale set automatically given data type (factor, numeric, integer) visual variable. tmap option scales.var contains information scale applied .","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: automatic scale — tm_scale","text":"","code":"tm_scale(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: automatic scale — tm_scale","text":"... arguments passed applied scale function tm_scale_*()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bar.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: scale bar — tm_scale_bar","title":"Map component: scale bar — tm_scale_bar","text":"function renamed tm_scalebar() tmap v4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: scale bar — tm_scale_bar","text":"","code":"tm_scale_bar(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: scale bar — tm_scale_bar","text":"... Arguments passed tm_scalebar breaks breaks width width text.size text.size text.color text.color color.dark color.dark color.light color.light lwd lwd position position bg.color bg.color bg.alpha bg.alpha size size stack stack frame frame frame.lwd frame.lwd frame.r frame.r margins margins z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bivariate.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: bivariate scale — tm_scale_bivariate","title":"Scales: bivariate scale — tm_scale_bivariate","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_bivariate() used bivariate.scales.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bivariate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: bivariate scale — tm_scale_bivariate","text":"","code":"tm_scale_bivariate( scale1 = tm_scale(), scale2 = tm_scale(), values = NA, values.repeat = FALSE, values.range = NA, values.scale = 1, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_bivariate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: bivariate scale — tm_scale_bivariate","text":"scale1, scale2 two tm_scale objects. Currently, tm_scale_*() functions supported except tm_scale_continous(). values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols()) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, grey scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark grey light grey used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle grey (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_categorical.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: categorical and ordinal scale — tm_scale_ordinal","title":"Scales: categorical and ordinal scale — tm_scale_ordinal","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). functions tm_scale_categorical() tm_scale_ordinal() used categorical data. difference functions former assumes unordered categories whereas latter assumes ordered categories. colors (visual variable fill col), different default color palettes used (see tmap option values.var).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_categorical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: categorical and ordinal scale — tm_scale_ordinal","text":"","code":"tm_scale_ordinal( n.max = 30, values = NA, values.repeat = FALSE, values.range = 1, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, levels = NULL, levels.drop = FALSE, labels = NULL, label.na = NA, label.null = NA, label.format = list() ) tm_scale_categorical( n.max = 30, values = NA, values.repeat = TRUE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, levels = NULL, levels.drop = FALSE, labels = NULL, label.na = NA, label.null = NA, label.format = list() )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_categorical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: categorical and ordinal scale — tm_scale_ordinal","text":"n.max Maximum number categories (factor levels). case , grouped n.max groups. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols()) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle gray (\"gray50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. levels Levels show. values treated missing. levels.drop unused levels dropped (therefore assigned visual value shown legend)? labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_continuous.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: continuous scale — tm_scale_continuous","title":"Scales: continuous scale — tm_scale_continuous","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_continuous() used continuous data. functions tm_scale_continuous_() use transformation functions x.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_continuous.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: continuous scale — tm_scale_continuous","text":"","code":"tm_scale_continuous( n = NULL, limits = NULL, outliers.trunc = NULL, ticks = NULL, trans = NULL, midpoint = NULL, values = NA, values.repeat = FALSE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA, label.format = list() ) tm_scale_continuous_log(...) tm_scale_continuous_log1p(...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_continuous.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: continuous scale — tm_scale_continuous","text":"n Preferred number tick labels. used ticks specified limits Limits data values mapped continuous scale outliers.trunc outliers truncated? outlier data value respectively lower upper limit. logical vector two values expected. first second value determines whether values lower lower limit respectively higher upper limit truncated lower respectively upper limit. FALSE (default), considered missing values. ticks Tick values. specified, determined automatically n trans Transformation function. One \"identity\" (default), \"log\", \"log1p\". Note: base log scale irrelevant, since log transformed values normalized mapping visual values. midpoint data value interpreted midpoint. default set 0 negative positive values present. Useful values diverging colors. case, two sides color palette assigned negative respectively positive values. values positive values negative, midpoint set NA, means value corresponds middle color class (see style) mapped middle color. specified sequential color palettes (e.g. \"Blues\"), color palette treated diverging color palette. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols()) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values, especially useful color palettes. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle gray (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3) ... passed tm_scale_continuous","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_discrete.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: discrete scale — tm_scale_discrete","title":"Scales: discrete scale — tm_scale_discrete","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_discrete() used discrete numerical data, integers.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_discrete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: discrete scale — tm_scale_discrete","text":"","code":"tm_scale_discrete( ticks = NA, midpoint = NULL, values = NA, values.repeat = FALSE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA, label.format = list() )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_discrete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: discrete scale — tm_scale_discrete","text":"ticks Discrete values. specified, determined automatically: unique values put discrete scale. midpoint data value interpreted midpoint. default set 0 negative positive values present. Useful values diverging colors. case, two sides color palette assigned negative respectively positive values. values positive values negative, midpoint set NA, means value corresponds middle color class (see style) mapped middle color. specified sequential color palettes (e.g. \"Blues\"), color palette treated diverging color palette. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols()) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"grey25\" \"grey75\"), 0, 0.5 means colors used black middle grey (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_intervals.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: interval scale — tm_scale_intervals","title":"Scales: interval scale — tm_scale_intervals","text":"Scales tmap configured family functions prefix tm_scale. function used input .scale arguments layer functions (e.g. fill.scale tm_polygons()). function tm_scale_interval() used numerical data.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_intervals.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: interval scale — tm_scale_intervals","text":"","code":"tm_scale_intervals( n = 5, style = ifelse(is.null(breaks), \"pretty\", \"fixed\"), style.args = list(), breaks = NULL, interval.closure = \"left\", midpoint = NULL, as.count = NA, values = NA, values.repeat = FALSE, values.range = NA, values.scale = NA, value.na = NA, value.null = NA, value.neutral = NA, labels = NULL, label.na = NA, label.null = NA, label.format = list() )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_intervals.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: interval scale — tm_scale_intervals","text":"n Number intervals. styles (see argument style ) preferred number rather exact number. style Method create intervals. Options \"cat\", \"fixed\", \"sd\", \"equal\", \"pretty\", \"quantile\", \"kmeans\", \"hclust\", \"bclust\", \"fisher\", \"jenks\", \"dpih\", \"headtails\", \"log10_pretty\". See details classInt::classIntervals() (extra arguments can passed via style.args). style.args List extra arguments passed classInt::classIntervals(). breaks Interval breaks (used required style==\"fixed\") interval.closure value determines whether intervals closed: \"left\" \"right\". .count = TRUE, inverval.closure always set \"left\". midpoint data value interpreted midpoint. default set 0 negative positive values present. Useful values diverging colors. case, two sides color palette assigned negative respectively positive values. values positive values negative, midpoint set NA, means value corresponds middle color class (see style) mapped middle color. specified sequential color palettes (e.g. \"Blues\"), color palette treated diverging color palette. .count data variable processed count variable? instance, style = \"pretty\", n = 2, value range variable 0 10, column classes .count = TRUE 0; 1 5; 6 10 (note 0 regarded category) whereas .count = FALSE 0 5; 5 10. applicable style \"pretty\", \"fixed\", \"log10_pretty\". default, TRUE style one , variable integer. values (generic scale argument) visual values. colors (e.g. fill col tm_polygons()) palette name cols4all package (see cols4all::c4a()) vector colors, size (e.g. size tm_symbols) set sizes (two values specified interpret range), symbol shapes (e.g. shape tm_symbols) set symbols, etc. tmap option values.var contains default values per visual variable cases also per data type. values.repeat (generic scale argument) values repeated case categories? values.range (generic scale argument) Range values. Vector two numbers (0 1) first determines minimum second maximum. Full range, means values used, encoded c(0, 1). instance, gray scale used color (black white), c(0,1) means colors used, 0.25, 0.75 means colors dark gray light gray used (precisely \"gray25\" \"gray75\"), 0, 0.5 means colors used black middle grey (\"grey50\"). one number specified, interpreted second number (first set 0). Default values can set via tmap option values.range. values.scale (generic scale argument) Scaling values. useful size-related visual variables, size tm_symbols() lwd tm_lines(). value.na (generic scale argument) Value used missing values. See tmap option \"value.na\" defaults per visual variable. value.null (generic scale argument) Value used NULL values. See tmap option \"value.null\" defaults per visual variable. Null data values occur --scope features shown (e.g. map Europe showing data variable per country, null values applied countries outside Europe). value.neutral (generic scale argument) Value can considered neutral. used legends visual variables map layer. E.g. fill size used tm_symbols() (using filled circles), size legend items filled value.neutral color fill.scale scale, fill legend items bubbles size value.neutral size.scale scale. labels (generic scale argument) Labels label.na (generic scale argument) Label missing values label.null (generic scale argument) Label null (--scope) values label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_rgb.html","id":null,"dir":"Reference","previous_headings":"","what":"Scales: RGB — tm_scale_rgb","title":"Scales: RGB — tm_scale_rgb","text":"Scales: RGB","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_rgb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: RGB — tm_scale_rgb","text":"","code":"tm_scale_rgb(value.na = NA, maxValue = 255)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scale_rgb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scales: RGB — tm_scale_rgb","text":"value.na value missing values maxValue maximum value","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scalebar.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: scale bar — tm_scalebar","title":"Map component: scale bar — tm_scalebar","text":"Map component adds scale bar. version 4.0, tm_scalebar() used instead tm_scale_bar() (now deprecated), potential confusion tm_scale_*() scaling functions (like tm_scale_continuous()).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scalebar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: scale bar — tm_scalebar","text":"","code":"tm_scalebar( breaks, width, text.size, text.color, color.dark, color.light, lwd, position, bg.color, bg.alpha, size = \"deprecated\", stack, frame, frame.lwd, frame.r, margins, z )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_scalebar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: scale bar — tm_scalebar","text":"breaks breaks width width text.size text.size text.color text.color color.dark color.dark color.light color.light lwd lwd position position bg.color bg.color bg.alpha bg.alpha size size stack stack frame frame frame.lwd frame.lwd frame.r frame.r margins margins z z","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: simple features — tm_sf","title":"Map layer: simple features — tm_sf","text":"Map layer draws simple features . Supported visual variables : fill (fill color), col (border color), size point size, shape symbol shape, lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) col_alpha (border color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: simple features — tm_sf","text":"","code":"tm_sf( fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, shape = tm_const(), shape.scale = tm_scale(), shape.legend = tm_legend(), shape.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, linejoin = \"round\", lineend = \"round\", plot.order.list = list(polygons = tm_plot_order(\"AREA\"), lines = tm_plot_order(\"LENGTH\"), points = tm_plot_order(\"size\")), trans.args.list = list(polygons = list(polygons.only = \"yes\"), lines = list(lines.only = \"yes\"), points = list(points.only = \"yes\")), mapping.args.list = list(polygons = list(), lines = list(), points = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256))), zindex = NA, group = NA, group.control = \"check\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: simple features — tm_sf","text":"fill, fill.scale, fill.legend, fill.free Visual variable determines fill color. See details. col, col.scale, col.legend, col.free Visual variable determines col color. See details. size, size.scale, size.legend, size.free Visual variable determines size. See details. shape, shape.scale, shape.legend, shape.free Visual variable determines shape. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. linejoin, lineend line join line end. See gpar() details. plot.order.list Specification order spatial features drawn. consists list three elementary geometry types: polygons, lines , points. types, drawn order, tm_plot_order() required. trans.args.list, mapping.args.list lists passed internal transformation mapping functions respectively. list three items, named polygons, lines, points. See tm_polygons(), tm_lines(), tm_dots(). zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control). group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). ... passed tm_polygons(), tm_lines(), tm_dots()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: simple features — tm_sf","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_() functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: simple features — tm_sf","text":"","code":"data(World) World$geometry[World$continent == \"Africa\"] <- sf::st_centroid(World$geometry[World$continent == \"Africa\"]) World$geometry[World$continent == \"South America\"] <- sf::st_cast(World$geometry[World$continent == \"South America\"], \"MULTILINESTRING\", group_or_split = FALSE) tm_shape(World) + tm_sf()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape.html","id":null,"dir":"Reference","previous_headings":"","what":"Shape (spatial object) specification — tm_shape","title":"Shape (spatial object) specification — tm_shape","text":"Specify shape, spatial object one spatial object class packages: sf, stars, terra.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shape (spatial object) specification — tm_shape","text":"","code":"tm_shape( shp, bbox = NULL, crs = NULL, is.main = NA, name = NULL, unit = NULL, filter = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shape (spatial object) specification — tm_shape","text":"shp Spatial object bbox Bounding box map (used .main = TRUE) crs CRS shp reprojected (used .main = TRUE) .main shp main shape, determines crs bounding box map? name Name shape unit Unit coordinates filter Filter features ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape_vars.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap function to specify all variables in the shape object — tm_shape_vars","title":"tmap function to specify all variables in the shape object — tm_shape_vars","text":"tmap function specify variables shape object","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_shape_vars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap function to specify all variables in the shape object — tm_shape_vars","text":"","code":"tm_shape_vars()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: symbols — tm_symbols","title":"Map layer: symbols — tm_symbols","text":"Map layer draws symbols Supported visual variables : fill (fill color), col (border color), size symbol size, shape symbol shape, lwd (line width), lty (line type), fill_alpha (fill color alpha transparency) col_alpha (border color alpha transparency).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: symbols — tm_symbols","text":"","code":"tm_symbols( size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, shape = tm_const(), shape.scale = tm_scale(), shape.legend = tm_legend(), shape.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, plot.order = tm_plot_order(\"size\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256)), zindex = NA, group = NA, group.control = \"check\", popup.vars = NA, popup.format = list(), hover = \"\", id = \"\", ... ) tm_dots( fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, plot.order = tm_plot_order(\"size\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256)), zindex = NA, group = NA, group.control = \"check\", ... ) tm_bubbles( size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, fill = tm_const(), fill.scale = tm_scale(), fill.legend = tm_legend(), fill.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, lwd = tm_const(), lwd.scale = tm_scale(), lwd.legend = tm_legend(), lwd.free = NA, lty = tm_const(), lty.scale = tm_scale(), lty.legend = tm_legend(), lty.free = NA, fill_alpha = tm_const(), fill_alpha.scale = tm_scale(), fill_alpha.legend = tm_legend(), fill_alpha.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, plot.order = tm_plot_order(\"size\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(icon.scale = 3, just = NA, grob.dim = c(width = 48, height = 48, render.width = 256, render.height = 256)), zindex = NA, group = NA, group.control = \"check\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: symbols — tm_symbols","text":"size, size.scale, size.legend, size.free Visual variable determines size. See details. fill, fill.scale, fill.legend, fill.free Visual variable determines fill color. See details. col, col.scale, col.legend, col.free Visual variable determines col color. See details. shape, shape.scale, shape.legend, shape.free Visual variable determines shape. See details. lwd, lwd.scale, lwd.legend, lwd.free Visual variable determines line width. See details. lty, lty.scale, lty.legend, lty.free Visual variable determines line type. See details. fill_alpha, fill_alpha.scale, fill_alpha.legend, fill_alpha.free Visual variable determines fill color alpha transparency See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See details. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). popup.vars names data variables shown popups \"view\" mode. Set popup.vars TRUE show variables shape object. Set popup.vars FALSE disable popups. Set popup.vars character vector variable names variables popups. default (NA) depends whether visual variables (e.g.col) used. , shown. variables shape object shown. popup.format list formatting options popup values. See argument legend.format options. applicable numeric data variables. one list formatting options provided, applied numeric variables popup.vars. Also, (named) list lists can provided. case, list formatting options applied named variable. hover name data variable specifies hover labels id name data variable specifies indices spatial features. used \"view\" mode. ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: symbols — tm_symbols","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_ functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()), one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_symbols.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: symbols — tm_symbols","text":"","code":"# load Africa country data data(World, metro) Africa = World[World$continent == \"Africa\", ] metro_A = sf::st_intersection(metro, Africa) #> Warning: attribute variables are assumed to be spatially constant throughout all geometries tm_shape(metro_A) + tm_symbols() tm_shape(Africa) + tm_polygons() + tm_shape(metro_A) + tm_symbols(fill = \"pop1950\", size = \"pop2030\", size.scale = tm_scale(values.scale = 2)) ##### tmap v3 data(World, metro) metro$growth <- (metro$pop2020 - metro$pop2010) / (metro$pop2010 * 10) * 100 tm_shape(World) + tm_fill(\"grey70\") + tm_shape(metro) + tm_bubbles(\"pop2010\", col = \"growth\", border.col = \"black\", border.alpha = .5, style=\"fixed\", breaks=c(-Inf, seq(0, 6, by=2), Inf), palette=\"-RdYlBu\", contrast=1, title.size=\"Metro population\", title.col=\"Growth rate (%)\") + tm_format(\"World\") #> Deprecated tmap v3 code detected. Code translated to v4 #> Variable(s) \"fill\" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette. tm_shape(metro) + tm_symbols(size = \"pop2010\", col=\"pop2010\", shape=\"pop2010\", legend.format = list(text.align=\"right\", text.to.columns = TRUE)) + tm_legend(outside = TRUE, outside.position = \"bottom\", stack = \"horizontal\") #> Deprecated tmap v3 code detected. Code translated to v4 #> Warning: v3 code detected: as of tmap v4, tm_legend should be specified per visual variable (e.g. with the argument fill.legend of tm_polygons if (require(ggplot2) && require(dplyr) && require(tidyr) && require(tmaptools) && require(sf)) { data(NLD_prov) origin_data <- NLD_prov %>% st_set_geometry(NULL) %>% dplyr::mutate(FID= factor(1:dplyr::n())) %>% dplyr::select(FID, origin_native, origin_west, origin_non_west) %>% tidyr::pivot_longer( cols = c(origin_native, origin_west, origin_non_west), names_to = \"origin\", values_to = \"perc\", names_transform = as.factor ) %>% dplyr::arrange(origin, FID) %>% as.data.frame() origin_cols <- get_brewer_pal(\"Dark2\", 3) grobs <- lapply(split(origin_data, origin_data$FID), function(x) { ggplotGrob(ggplot(x, aes(x=\"\", y=-perc, fill=origin)) + geom_bar(width=1, stat=\"identity\") + scale_y_continuous(expand=c(0,0)) + scale_fill_manual(values=origin_cols) + theme_ps(plot.axes = FALSE)) }) names(grobs) <- NLD_prov$name tm_shape(NLD_prov) + tm_polygons(group = \"Provinces\") + tm_symbols(size=\"population\", shape=\"name\", shapes=grobs, sizes.legend=c(.5, 1,3)*1e6, scale=1, legend.shape.show = FALSE, legend.size.is.portrait = TRUE, shapes.legend = 22, title.size = \"Population\", group = \"Charts\", id = \"name\", popup.vars = c(\"population\", \"origin_native\", \"origin_west\", \"origin_non_west\")) + tm_add_legend(type=\"fill\", group = \"Charts\", col=origin_cols, labels=c(\"Native\", \"Western\", \"Non-western\"), title=\"Origin\") + tm_format(\"NLD\") grobs2 = grobs grobs2[[6]] = 21 NLD_prov$population[1:5] = 500000 tm_shape(NLD_prov) + tm_polygons(group = \"Provinces\") + tm_symbols(shape=\"name\", fill = \"red\", col = \"blue\", size = \"population\", size.scale = tm_scale_continuous(values.scale = 4), shape.scale = tm_scale_categorical(values = grobs2), shape.legend = tm_legend_hide()) } #> Loading required package: ggplot2 #> Loading required package: dplyr #> #> Attaching package: ‘dplyr’ #> The following objects are masked from ‘package:stats’: #> #> filter, lag #> The following objects are masked from ‘package:base’: #> #> intersect, setdiff, setequal, union #> Loading required package: tidyr #> Loading required package: tmaptools #> Loading required package: sf #> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE #> Deprecated tmap v3 code detected. Code translated to v4 # TIP: check out these examples in view mode, enabled with tmap_mode(\"view\") if (FALSE) { if (require(rnaturalearth)) { airports <- ne_download(scale=10, type=\"airports\", returnclass = \"sf\") airplane <- tmap_icons(system.file(\"img/airplane.png\", package = \"tmap\")) current.mode <- tmap_mode(\"view\") tm_shape(airports) + tm_symbols(shape=airplane, size=\"natlscale\", legend.size.show = FALSE, scale=1, border.col = NA, id=\"name\", popup.vars = TRUE) #+ tm_view(set.view = c(lon = 15, lat = 48, zoom = 4)) tmap_mode(current.mode) } } ##################################################################################### if (FALSE) { # plot all available symbol shapes: if (require(ggplot2)) { ggplot(data.frame(p=c(0:25,32:127))) + geom_point(aes(x=p%%16, y=-(p%/%16), shape=p), size=5, fill=\"red\") + geom_text(mapping=aes(x=p%%16, y=-(p%/%16+0.25), label=p), size=3) + scale_shape_identity() + theme(axis.title=element_blank(), axis.text=element_blank(), axis.ticks=element_blank(), panel.background=element_blank()) } } tm_shape(metro) + tm_symbols(\"pop2010\", size.scale = tm_scale_continuous(n = 8, values.scale = 3), shape = 22) #> Warning: Some legend items or map compoments do not fit well (e.g. due to the specified font size). data(\"NLD_prov\") NLD_prov$x = seq(10, by = 5, length.out = 12) tm_shape(NLD_prov) + tm_symbols(size = \"x\", size.scale = tm_scale_continuous(values.scale = 4)) + tm_text(text = \"x\") tm_shape(metro) + tm_symbols(\"pop2010\", fill = \"pop2020\", fill.scale = tm_scale_continuous(), size.scale = tm_scale_continuous(), shape = 22)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":null,"dir":"Reference","previous_headings":"","what":"Map layer: text — tm_text","title":"Map layer: text — tm_text","text":"Map layer draws symbols Supported visual variables : text (text ) col (color), size (font size), fontface (font face).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map layer: text — tm_text","text":"","code":"tm_text( text = tm_const(), text.scale = tm_scale(), text.legend = tm_legend(), text.free = NA, size = tm_const(), size.scale = tm_scale(), size.legend = tm_legend(), size.free = NA, col = tm_const(), col.scale = tm_scale(), col.legend = tm_legend(), col.free = NA, col_alpha = tm_const(), col_alpha.scale = tm_scale(), col_alpha.legend = tm_legend(), col_alpha.free = NA, fontface = tm_const(), fontface.scale = tm_scale(), fontface.legend = tm_legend(), fontface.free = NA, fontfamily = \"\", shadow = FALSE, plot.order = tm_plot_order(\"AREA\", reverse = FALSE, na.order = \"bottom\"), trans.args = list(points.only = \"ifany\"), mapping.args = list(clustering = FALSE), zindex = NA, group = NA, group.control = \"check\", ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map layer: text — tm_text","text":"text, text.scale, text.legend, text.free Visual variable determines text. See details. size, size.scale, size.legend, size.free Visual variable determines font size. See details. col, col.scale, col.legend, col.free Visual variable determines col color. See details. col_alpha, col_alpha.scale, col_alpha.legend, col_alpha.free Visual variable determines border color alpha transparency. See Details. fontface, fontface.scale, fontface.legend, fontface.free Visual variable determines font face. See Details. fontfamily font family. See gpar() details. shadow Shadow behind text. Logical color. plot.order Specification order spatial features drawn. See tm_plot_order() details. trans.args, mapping.args lists passed internal transformation mapping functions respectively. zindex Map layers drawn top . zindex numbers (one map layer) determines stacking order. default map layers drawn order called. group Name group layer belongs. relevant view mode, layer groups can switched (see group.control) group.control view mode, group control determines layer groups can switched . Options: \"radio\" radio buttons (meaning one group can shown), \"check\" check boxes (multiple groups can shown), \"none\" control (group (de)selected). ... catch deprecated arguments version < 4.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Map layer: text — tm_text","text":"visual variable arguments (e.g. col) can specified either data variable name (object specified tm_shape()), visual value (col, color expected). Multiple values can specified: case facets created. facets can combined faceting data variables, specified tm_facets(). .scale arguments determine used scale map data values visual variable values. can specified one available tm_scale_() functions. default scale used specified tmap option scales.var. .legend arguments determine used legend, specified tm_legend(). default legend settings determined tmap options legend.. .free arguments determine whether scales applied freely across facets, shared. logical value required. can also specified vector three logical values; determine whether scales applied freely per facet dimension. useful facets applied (see tm_facets()). maximally three facet dimensions: rows, columns, pages. applies facet grid (tm_facets_grid()). instance, col.free = c(TRUE, FALSE, FALSE) means visual variable col, row facets scale, therefore legend. facet wraps stacks (tm_facets_wrap() tm_facets_stack()) one facet dimension, .free argument requires one logical value.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_text.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: text — tm_text","text":"","code":"data(rivers) tm_shape(rivers) + tm_lines() tm_shape(rivers) + tm_lines(lwd = \"scalerank\") tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lwd.scale = tm_scale_continuous(values.scale = 2, n = 20), lwd.legend = tm_legend(orientation = \"landscape\", item.width = 2), col = \"type\", col.scale = tm_scale(values = c(\"darkblue\", \"darkred\"))) tm_shape(rivers) + tm_lines(lwd = \"scalerank\", lty = \"scalerank\", col = \"scalerank\", col.scale = tm_scale_categorical(), lty.legend = tm_legend_combine(\"lwd\"), col.legend = tm_legend_combine(\"lwd\")) ### tmap3 tm_shape(World) + tm_fill() + tm_shape(rivers) + tm_lines(col=\"black\", lwd=\"scalerank\", scale=2, legend.lwd.show = FALSE) + tm_style(\"cobalt\", title = \"Rivers of the World\") + tm_format(\"World\") #> Deprecated tmap v3 code detected. Code translated to v4"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_title.html","id":null,"dir":"Reference","previous_headings":"","what":"Map component: title — tm_title","title":"Map component: title — tm_title","text":"Map component adds title","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_title.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map component: title — tm_title","text":"","code":"tm_title( text, size, color, padding, fontface, fontfamily, stack, just, frame, frame.lwd, frame.r, bg.color, bg.alpha, position, width, height, group.frame, resize.as.group, z ) tm_title_in(text, ..., position = tm_pos_in(\"left\", \"top\")) tm_title_out(text, ..., position = tm_pos_out(\"center\", \"top\"))"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_title.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map component: title — tm_title","text":"text text title size font size title color color padding padding fontface font face fontfamily font family stack stack just just frame frame frame.lwd frame.lwd frame.r frame.r bg.color bg.color bg.alpha bg.alpha position position width width height height group.frame group.frame resize..group resize..group z z ... passed tm_title","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_view.html","id":null,"dir":"Reference","previous_headings":"","what":"View mode options — tm_view","title":"View mode options — tm_view","text":"View mode options. options specific view mode.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_view.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"View mode options — tm_view","text":"","code":"tm_view( use.WebGL, control.position, control.bases, control.overlays, set.bounds, set.view, set.zoom.limits, leaflet.options )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_view.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"View mode options — tm_view","text":"use.WebGL use webGL layers leafgl control.position position control attribute control.bases base layers control.overlays overlay layers set.bounds logical determines whether maximum bounds set, bounding box. applicable plot mode. view mode, passed setMaxBounds() set.view numeric vector determines view. Either vector three: lng, lat, zoom, single value: zoom. See setView(). applicable bbox specified set.zoom.limits numeric vector two set minimum maximum zoom levels (see tileOptions()). leaflet.options options passed leafletOptions()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_xlab.html","id":null,"dir":"Reference","previous_headings":"","what":"Map: x and y labels — tm_xlab","title":"Map: x and y labels — tm_xlab","text":"x y labels maps","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_xlab.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Map: x and y labels — tm_xlab","text":"","code":"tm_xlab(text, size, color, rotation, space, fontface, fontfamily, side) tm_ylab(text, size, color, rotation, space, fontface, fontfamily, side)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tm_xlab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Map: x and y labels — tm_xlab","text":"text text title size font size title color color rotation rotation degrees space space label map number line heights fontface font face fontfamily font family side side: \"top\" \"bottom\" tm_xlab \"left\" \"right\" tm_ylab","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-element.html","id":null,"dir":"Reference","previous_headings":"","what":"Stacking of tmap elements — tmap-element","title":"Stacking of tmap elements — tmap-element","text":"plus operator allows stack tmap elements (functions prefix tm_)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-element.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Stacking of tmap elements — tmap-element","text":"","code":"# S3 method for tmap +(e1, e2)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-element.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stacking of tmap elements — tmap-element","text":"e1 first tmap element e2 second tmap element","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":null,"dir":"Reference","previous_headings":"","what":"Thematic Map Visualization — tmap-package","title":"Thematic Map Visualization — tmap-package","text":"Thematic maps geographical maps spatial data distributions visualized. package offers flexible, layer-based, easy use approach create thematic maps, choropleths bubble maps. based grammar graphics, resembles syntax ggplot2.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Thematic Map Visualization — tmap-package","text":"page provides brief overview package functions. See vignette(\"tmap_sneak_peek\") short introduction examples.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"main-plotting-method","dir":"Reference","previous_headings":"","what":"Main plotting method","title":"Thematic Map Visualization — tmap-package","text":"Shape specification: Aesthetics base layers: Aesthetics derived layers: Faceting (small multiples) Attributes: Layout element: Change options: Create icons:","code":""},{"path":[]},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Thematic Map Visualization — tmap-package","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Thematic Map Visualization — tmap-package","text":"Martijn Tennekes mtennekes@gmail.com","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapAddLayerOptions.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","title":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","text":"Internal tmap function add default value layer functions","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapAddLayerOptions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","text":"","code":"tmapAddLayerOptions(option, id, value)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapAddLayerOptions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to add a default value for the layer functions — tmapAddLayerOptions","text":"option, one : \"value.const\", \"value.na\", \"value.blank\", \"values.var\", 'values.range', \"value.neutral\", \"scales.var\" id name visual variable layer, format \"x.y\", x visual variable y layer. also possible set x ; applies layer functions. value value","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta1.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","title":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","text":"Internal method extracts meta data shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","text":"","code":"tmapGetShapeMeta1(shp, o)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta1.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that extracts meta data from shape objects — tmapGetShapeMeta1","text":"shp shape object o list options","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta2.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","title":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","text":"Internal method extracts meta data shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","text":"","code":"tmapGetShapeMeta2(shp, smeta, o)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapGetShapeMeta2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that extracts more meta data from shape objects — tmapGetShapeMeta2","text":"shp shape o list options shape meta (tmapGetShapeMeta1)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapShape.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that processed shape objects — tmapShape","title":"Internal method that processed shape objects — tmapShape","text":"Internal method processed shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapShape.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that processed shape objects — tmapShape","text":"","code":"tmapShape(shp, is.main, crs, bbox, unit, filter, shp_name, smeta, o, tmf)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapShape.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that processed shape objects — tmapShape","text":"shp shp .main .main crs crs bbox bbox unit unit filter filter shp_name shp_name smeta smeta o o tmf tmf","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSplitShp.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that split shape objects — tmapSplitShp","title":"Internal method that split shape objects — tmapSplitShp","text":"Internal method split shape objects. far, used split stars object (dimension attributes)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSplitShp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that split shape objects — tmapSplitShp","text":"","code":"tmapSplitShp(shp, split_stars_dim)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSplitShp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that split shape objects — tmapSplitShp","text":"shp shape split_stars_dim name dimension split (\"\" skip)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSubsetShp.html","id":null,"dir":"Reference","previous_headings":"","what":"Internal method that subsets data from shape objects — tmapSubsetShp","title":"Internal method that subsets data from shape objects — tmapSubsetShp","text":"Internal method subsets data shape objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSubsetShp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Internal method that subsets data from shape objects — tmapSubsetShp","text":"","code":"tmapSubsetShp(shp, vars)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmapSubsetShp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal method that subsets data from shape objects — tmapSubsetShp","text":"shp shape vars vector variable names","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":null,"dir":"Reference","previous_headings":"","what":"Create animation — tmap_animation","title":"Create animation — tmap_animation","text":"Create gif animation video tmap plot.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create animation — tmap_animation","text":"","code":"tmap_animation( tm, filename = NULL, width = NA, height = NA, dpi = NA, delay = 40, fps = NA, loop = TRUE, outer.margins = NA, asp = NULL, scale = NA, restart.delay = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create animation — tmap_animation","text":"tm tmap list tmap objects. tm tmap object, facets created, nrow ncol tm_facets() set 1 order create one map per frame. filename filename. omitted (default), animation shown viewer browser. specified, gif file video file (.e. mp4). package gifski required create gif animation. package av (uses FFmpeg library) required video formats. mp4 format recommended many video formats supported, wmv, avi, mkv. width, height Dimensions animation file (pixels). Required tm list, recommended specify advance tm tmap object. specified latter case, determined aspect ratio map. dpi dots per inch. default 100, can set option output.dpi.animation tmap_options(). delay delay time images (1/100th second). See also fps fps frames per second, calculated 100 / delay. fps specified, delay set 100/fps. loop logical determined whether animation looped, integer value determines many times animation looped. outer.margins (passed tmap_save()) overrides outer.margins argument tm_layout() (unless set NA) asp (passed tmap_save()) specified, overrides asp argument tm_layout(). Tip: set 0 map frame placed edges image. scale (passed tmap_save()) overrides scale argument tm_layout() (unless set NA) restart.delay used anymore. ... arguments passed av::av_encode_video()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create animation — tmap_animation","text":"tmap plots supported, series R plots.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_animation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create animation — tmap_animation","text":"","code":"if (FALSE) { data(NLD_prov) m1 <- tm_shape(NLD_prov) + tm_polygons(\"yellow\") + tm_facets(along = \"name\") tmap_animation(m1, delay=40) data(World, metro) m2 <- tm_shape(World, projection = \"+proj=eck4\", simplify = 0.5) + tm_fill() + tm_shape(metro) + tm_bubbles(size = paste0(\"pop\", seq(1970, 2030, by=10)), col = \"purple\", border.col = \"black\", border.alpha = .5, scale = 2) + tm_facets(free.scales.symbol.size = FALSE, nrow=1,ncol=1) + tm_format(\"World\") tmap_animation(m2, delay=100, outer.margins = 0) m3 <- lapply(seq(50, 85, by = 5), function(age) { World$at_most <- World$life_exp <= age World_sel <- World[which((World$life_exp <= age) & (World$life_exp > (age - 5))), ] tm_shape(World) + tm_polygons(\"at_most\", palette = c(\"gray95\", \"gold\"), legend.show = FALSE) + tm_shape(World_sel) + tm_text(\"name\", size = \"AREA\", root = 5, remove.overlap = TRUE) + tm_layout(main.title = paste0(\"Life expectency at most \", age), frame = FALSE) }) tmap_animation(m3, width = 1200, height = 600, delay = 100) m4 <- tm_shape(World) + tm_polygons() + tm_shape(metro) + tm_bubbles(col = \"red\") + tm_text(\"name\", ymod = -1) + tm_facets(by = \"name\", free.coords = F, nrow = 1, ncol = 1) + tm_layout(panel.show = FALSE, frame = FALSE) tmap_animation(m4, filename = \"World_cities.mp4\", width=1200, height = 600, fps = 2, outer.margins = 0) }"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":null,"dir":"Reference","previous_headings":"","what":"Arrange small multiples in grid layout — tmap_arrange","title":"Arrange small multiples in grid layout — tmap_arrange","text":"Arrange small multiples grid layout. Normally, small multiples created specifying multiple variables one aesthetic specifying argument (see tm_facets()). function can used arrange custom small multiples grid layout.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Arrange small multiples in grid layout — tmap_arrange","text":"","code":"tmap_arrange( ..., ncol = NA, nrow = NA, widths = NA, heights = NA, sync = FALSE, asp = 0, outer.margins = 0.02 ) knit_print.tmap_arrange(x, ..., options = NULL) # S3 method for tmap_arrange print(x, knit = FALSE, ..., options = NULL)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Arrange small multiples in grid layout — tmap_arrange","text":"... tmap objects one list tmap objects. number multiples can plot limited (see details). ncol number columns nrow number rows widths vector column widths. add 1 length equal ncol. heights vector row heights. add 1 length equal nrow. sync logical. navigation view mode (zooming panning) synchronized? default FALSE. asp aspect ratio. aspect ratio map. Normally, controlled asp argument tm_layout() (also tmap option). argument overwrite , unless set NULL. default value asp 0, means aspect ratio adjusted size device divided number columns rows. asp set NA, also default value tm_layout(), aspect ratio adjusted used shapes. outer.margins outer.margins, numeric vector four single value. defines outer margins multiple. overwrite outer.margins argument tm_layout(), unless set NULL. x tmap_arrange object (returned tmap_arrange()). options options passed knitr::knit_print() knit knitr::knit_print() enabled, normal base::print() function?","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Arrange small multiples in grid layout — tmap_arrange","text":"global option tmap.limits controls limit number facets plotted. default, tmap_options(tmap.limits = c(facets.view=4, facets.plot=64)). maximum number interactive facets set four since otherwise may become slow.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_arrange.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Arrange small multiples in grid layout — tmap_arrange","text":"","code":"tm1 = tm_shape(World) + tm_polygons(\"HPI\") tm2 = tm_shape(metro) + tm_bubbles(size = \"pop2020\") tmap_arrange(tm1, tm2)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_design_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the design mode — tmap_design_mode","title":"Set the design mode — tmap_design_mode","text":"-called \"design mode\" enabled, inner outer margins, legend position, aspect ratio shown explicitly plot mode. Also, information aspect ratios printed console. function sets global option tmap.design.mode. can used toggle function without arguments.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_design_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the design mode — tmap_design_mode","text":"","code":"tmap_design_mode(design.mode)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_design_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the design mode — tmap_design_mode","text":"design.mode Logical value determines design mode. omitted design mode toggled.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_devel_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the development mode — tmap_devel_mode","title":"Set the development mode — tmap_devel_mode","text":"-called \"development mode\" enabled, helpful messages timings printed console","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_devel_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the development mode — tmap_devel_mode","text":"","code":"tmap_devel_mode(devel.mode)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_devel_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the development mode — tmap_devel_mode","text":"devel.mode logical value determines development mode. omitted development mode toggled.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Get or add format options — tmap_format","title":"Get or add format options — tmap_format","text":"Format options tmap options shape dependent. tmap_format() predefined formats can retrieved. values specific format can retrieved tmap_format(format), format name format. function tmap_format_add() used add format.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get or add format options — tmap_format","text":"","code":"tmap_format(format) tmap_format_add(..., name)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get or add format options — tmap_format","text":"format Name format. Run tmap_format() see choices. ... Options tm_layout() tm_view(). Can also list options. name Name new format.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get or add format options — tmap_format","text":"function tmap_format() returns names available formats. format defined, returns option list corresponding format.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_format.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get or add format options — tmap_format","text":"","code":"# available formats tmap_format() #> available formats are: \"World\", \"World_wide\", \"NLD\", \"NLD_wide\" # create option list to be used as a new format World_small = tmap_format(\"World\") World_small$scale = 2 # add format tmap_format_add(World_small, name = \"World_small\") #> format World_small succesfully added. Use this format with tm_format(\"World_small\") # observe that World_small is successfully added: tmap_format() #> available formats are: \"World\", \"World_wide\", \"NLD\", \"NLD_wide\", \"World_small\" data(World) #qtm(World, fill=\"HPI\", format=\"World_small\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":null,"dir":"Reference","previous_headings":"","what":"Specify icons — tmap_icons","title":"Specify icons — tmap_icons","text":"Specifies icons png images, can used markers thematic maps. function marker_icon() specification default marker.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Specify icons — tmap_icons","text":"","code":"tmap_icons( file, width = 48, height = 48, keep.asp = TRUE, just = c(\"center\", \"center\"), as.local = TRUE, ... ) marker_icon()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Specify icons — tmap_icons","text":"file character value/vector containing file path(s) url(s). width width icon. keep.asp, interpreted maximum width. height height icon. keep.asp, interpreted maximum height. keep.asp keep aspect ratio png image. TRUE aspect ratio differs width/height, either width height adjusted accordingly. just justification icons relative point coordinates. first value specifies horizontal second value vertical justification. Possible values : \"left\" , \"right\", \"center\", \"bottom\", \"top\". Numeric values 0 specify left alignment 1 right alignment. default value just c(\"center\", \"center\"). .local file url, saved local temporary file? ... arguments passed leaflet::icons(). iconWidth, iconHeight, iconAnchorX, iconAnchorY specified, override width height, just.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_icons.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Specify icons — tmap_icons","text":"icon data (see leaflet::icons())","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_last.html","id":null,"dir":"Reference","previous_headings":"","what":"Retrieve the last map to be modified or created — tmap_last","title":"Retrieve the last map to be modified or created — tmap_last","text":"Retrieve last map modified created. Works way ggplot2::last_plot(), although difference: tmap_last() returns last call instead stacked tmap-elements.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_last.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Retrieve the last map to be modified or created — tmap_last","text":"","code":"tmap_last()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_last.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Retrieve the last map to be modified or created — tmap_last","text":"call","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":null,"dir":"Reference","previous_headings":"","what":"Export tmap to the format of the used graphics mode — tmap_leaflet","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"tmap_grid() returns grob object (\"plot\" mode) tmap_leaflet() leaflet object (\"view\" mode).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"","code":"tmap_leaflet(x, show = FALSE, ...) tmap_grid(x, show = FALSE, ...)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"x tmap object. show show map? ... Arguments passed print.tmap return.asp aspect ratio returned? vp viewport (\"plot\" mode)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"tmap_grid() returns grob object (\"plot\" mode) tmap_leaflet() leaflet object (\"view\" mode). case small multiples shown, list returned.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_leaflet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export tmap to the format of the used graphics mode — tmap_leaflet","text":"","code":"map = tm_shape(World) + tm_polygons() tmap_leaflet(map, show = TRUE)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":null,"dir":"Reference","previous_headings":"","what":"Set tmap mode to static plotting or interactive viewing — tmap_mode","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"Set tmap mode static plotting interactive viewing. global option tmap.mode determines whether thematic maps plot graphics device, shown interactive leaflet map (see also tmap_options(). function tmap_mode() wrapper set global option. convenient function ttm(), stands toggle thematic map, toggle switch two modes. function ttmp() stands toggle thematic map print last map: ttm() followed tmap_last(); order words, shows last map mode. recommended use tmap_mode() scripts ttm()/ttmp() console.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"","code":"tmap_mode(mode = NULL) ttm() ttmp()"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"mode One \"plot\" \"view\". See Details info.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"previous tmap mode switching.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"mode-plot-","dir":"Reference","previous_headings":"","what":"mode = \"plot\"","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"Thematic maps shown graphics device. default mode, supports tmap's features, small multiples (see tm_facets()) extensive layout settings (see tm_layout()). recommended use tmap_save() saving static maps.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"mode-view-","dir":"Reference","previous_headings":"","what":"mode = \"view\"","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"Thematic maps viewed interactively web browser RStudio's Viewer pane. Maps fully interactive tiles OpenStreetMap map providers (see tm_tiles()). See also tm_view() options related \"view\" mode. mode generates leaflet::leaflet() widget, can also directly obtained tmap_leaflet(). R Markdown, possible publish HTML page. However, couple constraints comparison \"plot\": map always projected according Web Mercator projection. Although projection de facto standard interactive web-based mapping, lacks equal-area property, important many thematic maps, especially choropleths (see examples tm_shape()). Small multiples supported legend made aesthetics regarding size, symbol size line width. Text labels supported (yet) layout options set tm_layout()) regarding map format used. However, styling options still apply.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"Tennekes, M., 2018, tmap: Thematic Maps R, Journal Statistical Software, 84(6), 1-39, doi:10.18637/jss.v084.i06","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_mode.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set tmap mode to static plotting or interactive viewing — tmap_mode","text":"","code":"tmap_mode() #> current tmap mode is \"plot\" tmap_mode(\"plot\") #> tmap mode set to 'plot' tm_shape(World) + tm_polygons(\"HPI\") tmap_mode(\"view\") #> tmap mode set to 'view' tm_shape(World) + tm_polygons(\"HPI\") ttm() #> tmap mode set to 'plot' tm_shape(World) + tm_polygons(\"HPI\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_options.html","id":null,"dir":"Reference","previous_headings":"","what":"tmap options — tmap_options","title":"tmap options — tmap_options","text":"tmap options","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_options.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"tmap options — tmap_options","text":"","code":"tmap_options(...) tmap_options_mode(mode = NA, default.options = FALSE) tm_options(...) tmap_options_diff() tmap_options_reset() tmap_options_save(style)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_options.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"tmap options — tmap_options","text":"... See details mode mode, e.g. \"plot\" \"view\" default.options return default options current options? style style, see tmap_style() available styles","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":null,"dir":"Reference","previous_headings":"","what":"Save tmap — tmap_save","title":"Save tmap — tmap_save","text":"Save tmap file. can either static plot (e.g. png) interactive map (html).","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save tmap — tmap_save","text":"","code":"tmap_save( tm = NULL, filename = NA, device = NULL, width = NA, height = NA, units = NA, dpi = NA, outer.margins = NA, asp = NULL, scale = NA, insets_tm = NULL, insets_vp = NULL, add.titles = TRUE, in.iframe = FALSE, selfcontained = !in.iframe, verbose = NULL, ... )"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save tmap — tmap_save","text":"tm tmap object filename filename including extension, optionally path. extensions pdf, eps, svg, wmf (Windows ), png, jpg, bmp, tiff, html supported. extension missing, file saved static plot \"plot\" mode interactive map (html) \"view\" mode (see details). default format static plots png, can changed using option \"output.format\" tmap_options(). NA (default), file saved \"tmap01\" default format, number incremented file already exists. device graphic device use. Either device function (e.g., png cairo_pdf) text indicating selected graphic device: \"pdf\", \"eps\", \"svg\", \"wmf\" (Windows ), \"png\", \"jpg\", \"bmp\", \"tiff\". NULL, graphic device guessed based filename argument. height, width dimensions plot (applicable html files). Units set argument units. one specified, calculated using formula asp = width / height, asp estimated aspect ratio map. missing, set width * height equal option \"output.size\" tmap_options(). default 49, meaning map square (aspect ratio 1) width height set 7. units units width height (\"\", \"cm\", \"mm\"). default, pixels (\"px\") used either width height set value greater 50. Else, units inches (\"\"). dpi dots per inch. applicable raster graphics. default set 300, can changed using option \"output.dpi\" tmap_options(). outer.margins overrides outer.margins argument tm_layout() (unless set NA) asp specified, overrides asp argument tm_layout(). Tip: set 0 map frame placed edges image. scale overrides scale argument tm_layout() (unless set NA) insets_tm tmap object inset map, list tmap objects multiple inset maps. number tmap objects equal number viewports specified insets_vp. insets_vp viewport inset map, list viewports multiple inset maps. number viewports equal number tmap objects specified insets_tm. add.titles add titles leaflet object. .iframe interactive map saved iframe? , two HTML files saved; one small parent HTML file iframe container, one large child HTML file actual widget. See widgetframe::saveWidgetframe() details. default FALSE, means one large HTML file saved (see saveWidget()). selfcontained interactive map saved, resources (e.g. JavaScript libraries) contained HTML file? FALSE, placed adjacent directory (see also htmlwidgets::saveWidget()). Note HTML file often still large selfcontained = FALSE, since map data (polygons popups), also contained HTML file, usually take space map resources. verbose Deprecated. now controlled tmap option show.messages (see tmap_options()) ... arguments passed device functions saveWidget() saveWidgetFrame()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_save.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save tmap — tmap_save","text":"","code":"if (FALSE) { data(NLD_muni, NLD_prov) m <- tm_shape(NLD_muni) + tm_fill(col=\"population\", convert2density=TRUE, style=\"kmeans\", title=expression(\"Population (per \" * km^2 * \")\")) + tm_borders(\"black\", alpha=.5) + tm_shape(NLD_prov) + tm_borders(\"grey25\", lwd=2) + tm_style(\"classic\") + tm_format(\"NLD\", inner.margins = c(.02, .15, .06, .15)) + tm_scale_bar(position = c(\"left\", \"bottom\")) + tm_compass(position=c(\"right\", \"bottom\")) tmap_save(m, \"choropleth.png\", height = 7) # height interpreted in inches tmap_save(m, \"choropleth_icon.png\", height = 100, scale = .1) # height interpreted in pixels data(World) m2 <- tm_shape(World) + tm_fill(\"well_being\", id=\"name\", title=\"Well-being\") + tm_format(\"World\") # save image tmap_save(m2, \"World_map.png\", width=1920, height=1080, asp=0) # cut left inner margin to make sure Antarctica is snapped to frame tmap_save(m2 + tm_layout(inner.margins = c(0, -.1, 0.05, 0.01)), \"World_map2.png\", width=1920, height=1080, asp=0) # save interactive plot tmap_save(m2, \"World_map.html\") }"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":null,"dir":"Reference","previous_headings":"","what":"Set or get the default tmap style — tmap_style","title":"Set or get the default tmap style — tmap_style","text":"Set get default tmap style. Without arguments, current style returned. Also available styles displayed. style set, corresponding tmap options (see tmap_options()) set accordingly. default style (.e. loading package) \"white\".","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set or get the default tmap style — tmap_style","text":"","code":"tmap_style(style)"},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set or get the default tmap style — tmap_style","text":"style Name style. omitted, tmap_style() returns current style also shows available styles. style specified,tmap_style() sets style accordingly. Note case, tmap options (see tmap_options()) reset according style definition. See tm_layout() predefined styles, tmap_style_catalogue (migrated v4 yet) creating catalogue.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set or get the default tmap style — tmap_style","text":"style changing","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set or get the default tmap style — tmap_style","text":"Note tm_style() used within plot call (affects plot), whereas tmap_style() sets style globally. loading style, options defined style (.e. difference default \"white\" style) can obtained tmap_options_diff(). documentation tmap_options() (details examples) shows create new style.","code":""},{"path":[]},{"path":"https://r-tmap.github.io/tmap/dev/reference/tmap_style.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set or get the default tmap style — tmap_style","text":"","code":"tmap_style() #> current tmap style is \"v3 (modified)\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"v3\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\") tmap_style(\"cobalt\") #> tmap style set to \"cobalt\" #> other available styles are: \"white\", \"gray\", \"natural\", \"albatross\", \"classic\", \"v3\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\") # for backwards compatibility, the styles of tmap versions 1-3 are also included: tmap_style(\"v3\") #> tmap style set to \"v3\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"cobalt_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\") tmap_style(\"cobalt_v3\") #> tmap style set to \"cobalt_v3\" #> other available styles are: \"white\", \"gray\", \"natural\", \"cobalt\", \"albatross\", \"classic\", \"v3\", \"gray_v3\", \"grey_v3\", \"natural_v3\", \"albatross_v3\", \"classic_v3\" tm_shape(World) + tm_polygons(\"HPI\")"},{"path":"https://r-tmap.github.io/tmap/dev/reference/v4-not-yet.html","id":null,"dir":"Reference","previous_headings":"","what":"These functions will be implemented soon — v4-not-yet","title":"These functions will be implemented soon — v4-not-yet","text":"functions implemented soon","code":""},{"path":"https://r-tmap.github.io/tmap/dev/reference/v4-not-yet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"These functions will be implemented soon — v4-not-yet","text":"","code":"tm_squares() tm_iso() tm_markers() tm_logo() tm_minimap()"},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-40-development-version","dir":"Changelog","previous_headings":"","what":"tmap 4.0 (development version)","title":"tmap 4.0 (development version)","text":"consistency ggplot2, tm_polygons() now recognizes fill argument instead col.","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-4","dir":"Changelog","previous_headings":"","what":"tmap 3.3-4","title":"tmap 3.3-4","text":"CRAN release: 2023-09-12 (!) last version tmap 3.x. Next CRAN version tmap 4.x (release planned end 2023) fixed bug (stars appeared upside plot mode) fixed newly introduced shiny bug (#767)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-3","dir":"Changelog","previous_headings":"","what":"tmap 3.3-3","title":"tmap 3.3-3","text":"CRAN release: 2022-03-02 added device tmap_save() fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-2","dir":"Changelog","previous_headings":"","what":"tmap 3.3-2","title":"tmap 3.3-2","text":"CRAN release: 2021-06-16 Worlds fixed (now ‘s2’ proof, see GitHub issue #564)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33-1","dir":"Changelog","previous_headings":"","what":"tmap 3.3-1","title":"tmap 3.3-1","text":"CRAN release: 2021-03-15 fixed view titles added html.escape popup.format control whether html code escaped view popups fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-33","dir":"Changelog","previous_headings":"","what":"tmap 3.3","title":"tmap 3.3","text":"CRAN release: 2021-01-19 tmap_grob() added, exports tmap plots grob objects (grid package) SpatRaster objects (terra package) supported fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-32","dir":"Changelog","previous_headings":"","what":"tmap 3.2","title":"tmap 3.2","text":"CRAN release: 2020-09-15 tmap_animation() improved: now using av gifski hood; added progress bar; lists tmap objects supported; improved default settings improved tmapOutput(); now works reactive shiny objects improved internally used margins; also small exported maps look good (see example tmap_save()) improved tmap_design_mode(); tmap.design.mode now global option (tmap option anymore) reexported providers leafet added show.warnings tmap_options() added width argument tm_credits() tm_text() improved: added “id” argument, tm_remove_layer() can applied ","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-31","dir":"Changelog","previous_headings":"","what":"tmap 3.1","title":"tmap 3.1","text":"CRAN release: 2020-07-09 interactive maps origin CRS working: tmap_options(projection = 0, basemaps = NULL) added tm_mouse_coordinates() show mouse coordinates view mode added tmap_design_mode() toggle design mode. made backgrond symbol grob shapes transparent added .iframe selfcontained tmap_save() improved tm_add_legend(): added type = \"title\" title legend elements added ttmp() shows last map mode. fixed many small bugs (see GitHub issue list)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-30","dir":"Changelog","previous_headings":"","what":"tmap 3.0","title":"tmap 3.0","text":"CRAN release: 2020-04-09 [!] spatial rasters/arrays now implemented using stars package (instead raster package) .count argument added layer functions; numeric variables can treated count variables (integers) drop.levels argument added layer functions allows drop unused levels new style added color classes: “dpih” “headtails”; also added style.args pass arguments classInt::classIntervals() grid labels specification per axis fixed bug geometry collection","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-23-2","dir":"Changelog","previous_headings":"","what":"tmap 2.3-2","title":"tmap 2.3-2","text":"CRAN release: 2020-01-19 probably last version release tmap 3.0 many small improvements bug fixes (see GitHub) first stars supported (full support expected tmap 3.0) replaced projection shortcuts \"epsg/proj4strings\" examples","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-23-1","dir":"Changelog","previous_headings":"","what":"tmap 2.3-1","title":"tmap 2.3-1","text":"CRAN release: 2019-09-17 improved popups view mode added validity checks sf objects minor bugs fixed: see GitHub issue list","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-23","dir":"Changelog","previous_headings":"","what":"tmap 2.3","title":"tmap 2.3","text":"CRAN release: 2019-07-18 [!] shiny integration: added tmapOutput(), renderTmap(), tmapProxy(), , tm_remove_layer() improved tmap_save() (regarding default values) improved tm_rgb() (added r g b max.value arguments) added tm_graticules() supported TMS servers view mode, layers can hidden legend group = NULL replaced mapview leafsync minor bugs fixed: see GitHub issue list","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-22","dir":"Changelog","previous_headings":"","what":"tmap 2.2","title":"tmap 2.2","text":"CRAN release: 2019-01-05 improved tm_rgb() improved breaks interactive maps added bbox argument qtm() improved projection shortcut codes (using EPSG database) fixed several bugs (see GitHub)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-21-1","dir":"Changelog","previous_headings":"","what":"tmap 2.1-1","title":"tmap 2.1-1","text":"CRAN release: 2018-08-09 fixed two small bugs","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-21","dir":"Changelog","previous_headings":"","what":"tmap 2.1","title":"tmap 2.1","text":"CRAN release: 2018-08-06 added option max.raster (maximum raster size) made rasters view mode faster bug fixed geometry collection objects without data view mode improved handling manual palettes tmap_arrange() can take list tmap objects","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-20","dir":"Changelog","previous_headings":"","what":"tmap 2.0","title":"tmap 2.0","text":"CRAN release: 2018-07-15 [!] tmap migrated sp sf. sp objects still supported, internal functions based sf [!] added tm_sf() draws sf objects [!] renamed *_tmap() functions (e.g. save_tmap()) tmap_*() consistency [!] added tm_basemap() tm_tiles(): now, multiple (overlay) tiled maps can shown [!] rearranged tmap options, styles formats. See tmap_options(), tmap_style(), tmap_format(), tm_style() tm_format() [!] added filter argument tm_shape() added colorNULL layer functions added tm_minimap() added remove.NA.facets tm_facets() units data columns supported tmap_animation() enhanced loop options added tmap_tips() changes backwards compatible 1.11-2 vignettes rewritten, including vignette describes changes 2.0","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-111-2","dir":"Changelog","previous_headings":"","what":"tmap 1.11-2","title":"tmap 1.11-2","text":"CRAN release: 2018-04-10 added references JSS paper (including citation)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-111-1","dir":"Changelog","previous_headings":"","what":"tmap 1.11-1","title":"tmap 1.11-1","text":"CRAN release: 2018-02-13 fixed bug labels argument tm_fill() fixed bug regarding legend symbols facets free scales fixed bug rasters view mode improved popup width view mode","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-111","dir":"Changelog","previous_headings":"","what":"tmap 1.11","title":"tmap 1.11","text":"CRAN release: 2017-11-24 added text.align text..columns legend.format legend.(aes).reverse added layer functions symbol shapes can put list small multiples, named according values variable specified shape argument grid labels can now rotated formatted changed default values free.coords drop.units tm_facets() fixed bug NAs view mode fixed bug dismo::gmap() raster shapes fixed bug ambiguous values aesthetics (e.g. “blue” also variable name) NOTE: last version major update (sf fully replaces sp)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-110","dir":"Changelog","previous_headings":"","what":"tmap 1.10","title":"tmap 1.10","text":"CRAN release: 2017-05-11 [!] tm_scale_bar(), tm_text(), tm_grid() now supported view mode (requires leaflet 1.1.0) added along argument tm_facets(), enables faceting along multiple pages (animation frames) added main.title argument tm_layout added tmap_options(), including new option tmap.unit (“metric” “imperial”“) improved automatic labelling breaks improved legend view mode: missing values shown default (like plot mode) improved bubble scaling view mode fixed bug aspect ratio bug","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-18-1","dir":"Changelog","previous_headings":"","what":"tmap 1.8-1","title":"tmap 1.8-1","text":"CRAN release: 2017-01-29 added tm_rgb() (shortcut rgb rasters) fixed interactive maps R Markdown fixed bug qtm() called without arguments","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-18","dir":"Changelog","previous_headings":"","what":"tmap 1.8","title":"tmap 1.8","text":"CRAN release: 2017-01-03 [!] package split: non-plotting functions migrated tmaptools added tmap_arrange() arranging custom small multiples added simplify argument tm_shape() added error message NA-projected shapes view mode improved unit handling, now can set metric imperial NA values allowed direct color variables sf (simple features) objects supported","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-16-1","dir":"Changelog","previous_headings":"","what":"tmap 1.6-1","title":"tmap 1.6-1","text":"CRAN release: 2016-10-29 improved projections: code efficient now shortcuts renewed. Also, CRS objects now supported project arguments (e.g. tm_shape(), set_projection), .CRS added get_projection get_proj4. Rscript works: methods moved imports depends","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-16","dir":"Changelog","previous_headings":"","what":"tmap 1.6","title":"tmap 1.6","text":"CRAN release: 2016-10-21 [!] tm_symbols() added, create proportional symbol maps: besides bubbles, also supports symbol shapes, png icons, small ggplot2 plots [!] imported cartogram function cartogram package (thanks Sebastian!) [!] reverse geocoding function tmaptools::rev_geocode_OSM() added [!] tm_logo() added added popup.vars base layer functions bounding box (argument bbox tm_shape()) working view mode tmaptools::geocode_OSM() improved: SpatialPointsDataFrame can now returned last_tmap() added, retrieves last produced map crop_shape can also handle polygons cropping area append_data improved; coverage information can retrieved under_coverage over_coverage interpolate parameter added tm_raster() added support custom legend formatting functions legend items can now stacked horizontally legend width height can determined fully manually (negative values legend.height legend.width) argument interval.closure added layer functions determine intervals closed added warnings non-supported elements view mode fixed raster brick bug fixed save_tmap/get_asp_ratifo bug","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-14-1","dir":"Changelog","previous_headings":"","what":"tmap 1.4-1","title":"tmap 1.4-1","text":"CRAN release: 2016-05-07 add just argument anchor text labels, legend attributes position map attributes (scale bar) can placed outside frame added tm_xlab() tm_ylab() RGB raster support, see tm_raster static text (.e titles, credits, legend titles, labels) support expressions updated Europe shape: projection bounding box now consistent Eurostat publications added crop_shape, convenient wrapper around raster::crop()","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-14","dir":"Changelog","previous_headings":"","what":"tmap 1.4","title":"tmap 1.4","text":"CRAN release: 2016-03-18 [!] interactive mapping added. Now, tmap two modes: “plot” (graphics device) “view” (interactive viewer, leaflet widget) [!] facets (small multiples) improved: group two variables possible, panel layout added, missing data can shown separately added geocode_OSM(), function find coordinates (now tmaptools::geocode_OSM()) improved set_projection raster objects added double_line offset_line added insets option save_tmap improved default settings contrast argument regarding seq div palettes improved automatic positions legend map attributes (specifically, legend snaps right-hand side without need adjust legend.width, legend attributes position improved double frame enabled) improved tm_layouts()’s design.mode output lwd parameter added tm_scale_bar() tm_compass() fixed bb bug","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-12-1","dir":"Changelog","previous_headings":"","what":"tmap 1.2-1","title":"tmap 1.2-1","text":"fixed bug PROJ.4 version < 4.9.1 improved error messages rd projection reset \"+init=epsg:28992\", since latter now \"+towgs\" item fixed bug print.tmap() returned object","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-12","dir":"Changelog","previous_headings":"","what":"tmap 1.2","title":"tmap 1.2","text":"CRAN release: 2015-12-11 added read_osm(), function read Open Street Map data (now tmaptools::read_osm()) added bb, handy bounding box function added layout themes tm_style tm_format added automatic text labeling added interactive SVG, can opened RStudio (see itmap) added map compass (tm_compass()) added text aesthetics size col added automatic map coloring added earth boundary, useful projected world maps World added warped grid lines (e.g. long-lat lines can shown projected maps) added new color scale modes (enabled style=\"cat\", “cont”, “order”) added save_tmap() added smooth_map, smooth_raster_cover, sample_dots, points_to_raster poly_to_raster added read_GPX improved automatic layout regarding title, legend, map attributes layer arguments, e.g. palette, can take multiple values small multiples improved grid lines (labels can also placed outside frame) arguments free.coords drop.shapes tm_facets() working updated examples vignette fixed viewport bug see ?tmap structured overview tmap functions","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-10","dir":"Changelog","previous_headings":"","what":"tmap 1.0","title":"tmap 1.0","text":"CRAN release: 2015-05-28 added tm_credits() tm_scale_bar() added .master argument tm_shape(), determines shape master added unit unit.size arguments tm_shape() correlates coordinates desired units added tm_polygons(), combination tm_fill() tm_borders() fixed several small bugs","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-08","dir":"Changelog","previous_headings":"","what":"tmap 0.8","title":"tmap 0.8","text":"added tm_raster() improved legend behavior: legend titles set layer functions (instead tm_layout()) removed crop_shape(), since raster::crop() job, , faster --scope functions migrated spatialToolbox package, available https://github.com/mtennekes/spatialToolbox","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-071","dir":"Changelog","previous_headings":"","what":"tmap 0.7.1","title":"tmap 0.7.1","text":"fixed bug scale parameter (global scale set tm_layout())","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-07","dir":"Changelog","previous_headings":"","what":"tmap 0.7","title":"tmap 0.7","text":"CRAN release: 2015-03-27 enhanced small multiples (tm_facets()) respect scaling free coordinate scales added alpha argument tm_layers() transparency added text shadow argument added function split() split shape object sbind() combine shape objects. added automatic legend positioning legend.position = NULL improved number formatting legend improved inner.margins outer.margins. can take one value (e.g. outer.margins=0 rather outer.margins=c(0,0,0,0)) improved qtm(): tm_facets() parameters working, also fixed scale parameter bug improved examples approx_areas, calc_densities fixed bug regarding drawing frame outer.margins=0. fixed bug plotting bubbles improved temp file handling animation_tmap() added functions get set polygon directions, calculate intersection ratios polygons (intersection_shapes)","code":""},{"path":"https://r-tmap.github.io/tmap/dev/news/index.html","id":"tmap-06","dir":"Changelog","previous_headings":"","what":"tmap 0.6","title":"tmap 0.6","text":"CRAN release: 2014-07-30 first CRAN version newer version may available https://github.com/r-tmap/tmap get started, see package vignette ‘tmap nutshell’ help files questions suggestions, please contact (mtennekes gmail dot com)","code":""}]