@@ -75,13 +75,13 @@
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 a new style is created.
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, and tmap_style_catalogue
(not migrated to v4 yet) to create a style catalogue of all available styles.
diff --git a/search.json b/search.json
index cc7cebef..9106842e 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"/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":"/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":"/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”: (haven’t decided whether include tm_cartogram tmap package extension package, e.g., tmapCartogram tmapExtra. Let us know opinion https://github.com/r-tmap/tmap/issues/565)","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 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 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":"/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":"/articles/tmap_sneak_peek.html","id":"multivarite-scales","dir":"Articles","previous_headings":"","what":"Multivarite 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":"/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":"/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":"/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":"/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":"/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 colomn. 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":"/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":"/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":"/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 panel 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":"/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/mtennekes/tmap/issues, please use tmap_v4 tag.","code":""},{"path":"/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 2022.","code":""},{"path":"/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 visual variable \"fill\" : \"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":"/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 gplot2 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, ggplot(), spatial class requires custom map layer function, e.g. geom_sf() sf objects. tmap static plot mode interactive mode. …","code":""},{"path":"/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":"/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":"/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":"/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\") 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":"/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":"tm_shape(World, crs = 8857) + tm_cartogram(size = \"pop_est\", fill = \"income_grp\") ## Cartogram in progress... ## Loading required namespace: cartogram ## 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":"/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":"/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.","code":""},{"path":"/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":"/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":"/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":"/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 options(repos = c( tmap = 'https://r-tmao.r-universe.dev', CRAN = 'https://cloud.r-project.org')) install.packages('tmap')"},{"path":"/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Thematic Maps","text":"","code":"library(tmap)"},{"path":"/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":"/index.html","id":"vignettes","dir":"","previous_headings":"","what":"Vignettes","title":"Thematic Maps","text":"tmap: get started! tmap: changed recent versions?","code":""},{"path":"/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Thematic Maps","text":"tmap RMarkdown","code":""},{"path":"/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":"/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 visualising spatial data R Blog post StatialControl Blog post TWIAV Computer World: Create maps R 10 (fairly) easy steps Computer World: Great R packages data import, wrangling visualization Tutorial Visualising spatial data: base shiny - workshop Stack Overflow questions (#tmap)","code":""},{"path":"/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":"/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":"/reference/Shapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"World and Netherlands map — World","text":"","code":"data(World) data(NLD_prov) data(NLD_muni)"},{"path":"/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":"/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 cited Statistics Netherlands (CBS) Kadaster Nederland source.","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/reference/land.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of global land cover — land","text":"","code":"data(land)"},{"path":"/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":"/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":"/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":"/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":"/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":"/reference/metro.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatial data of metropolitan areas — metro","title":"Spatial data of metropolitan areas — metro","text":"Spatial data metropolitan areas, class sf. data includes population times series 1950 (forecasted) 2030. metro areas 1 million inhabitants 2010 included.","code":""},{"path":"/reference/metro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of metropolitan areas — metro","text":"","code":"data(metro)"},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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. OSM 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 seperately 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. Arugment 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":"/reference/qtm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quick thematic map plot — qtm","text":"tmap-element","code":""},{"path":"/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":"/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":"/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":"/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":"/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, class sf","code":""},{"path":"/reference/rivers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of rivers — rivers","text":"","code":"data(rivers)"},{"path":"/reference/rivers.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Spatial data of rivers — rivers","text":"https://www.naturalearthdata.com","code":""},{"path":"/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":"/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":"/reference/shapeTM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to create a tmap shape — shapeTM","text":"shp shp tmapID tmapID bbox bbox","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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. function 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":"/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":"/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":"/reference/tm_basemap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"","code":"tm_basemap() + tm_shape(World) + tm_polygons(\"HPI\") #> Loading required namespace: maptiles tm_basemap(\"OpenTopoMap\") + tm_shape(World) + tm_polygons(fill = NA, col = \"black\")"},{"path":"/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":"/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":"/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 ... passd tm_polygons","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 deceprated Please use tm_facets_page ... paseed `tm_facets`","code":""},{"path":"/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 acording coordinate system (master) shape object. Latitude longitude graticules drawn tm_graticules.","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/tm_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Legend — tm_legend","title":"Legend — tm_legend","text":"Legend specification","code":""},{"path":"/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":"/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":"/reference/tm_legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Legend — tm_legend","text":"OUTPUT_DESCRIPTION","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/tm_mv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"define multivariate variable — tm_mv","text":"","code":"tm_mv(...)"},{"path":"/reference/tm_mv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"define multivariate variable — tm_mv","text":"... variable names","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 colours 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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/tm_scale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: automatic scale — tm_scale","text":"","code":"tm_scale(...)"},{"path":"/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":"/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":"/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":"/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":"/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_bivariat usedf bivariate.scales","code":""},{"path":"/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":"/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 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":"/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":"/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":"/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 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. 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":"/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":"/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":"/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 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, 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 label.format (generic scale argument) Label formatting (similar legend.format tmap3) ... passed `tm_scale_continuous`","code":""},{"path":"/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":"/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":"/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 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 label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"/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":"/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":"/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 classIntervals (extra arguments can passed via style.args). style.args List extra arguments passed 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 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 label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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-getstarted\") short introduction examples.","code":""},{"path":[]},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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_encode_video","code":""},{"path":"/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":"/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":"/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":"/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":"/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 knitprint knit knit_print enabled, normal print function?","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 icons. iconWidth, iconHeight, iconAnchorX iconAnchorY specified, override width height, just.","code":""},{"path":"/reference/tmap_icons.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Specify icons — tmap_icons","text":"icon data (see icons)","code":""},{"path":[]},{"path":"/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's last_plot, although difference: last_map returns last call instead stacked tmap-elements.","code":""},{"path":"/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":"/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":"/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":"Export tmap format used graphics mode. `tmap_grid` returns grob object (\"plot\" mode) `tmap_leaflet` leaflet object (\"view\" mode).","code":""},{"path":"/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":"/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 description show show map? ... arguments passed print.tmap","code":""},{"path":"/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":"/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":"/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":"/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":"/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 widget, can also directly obtained tmap_leaflet. RMarkdown, 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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 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 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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 World fixed (now ‘s2’ proof, see github issue #564)","code":""},{"path":"/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":"/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":"/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":"/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 desgin 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":"/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 classIntervals grid labels specification per axis fixed bug geometry collection","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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 xxx_tmap functions (e.g. save_tmap) tmap_xxx 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":"/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":"/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":"/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 NA’s 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":"/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 (required leaflet 1.1.0) added along argument tm_facets, enables facetting along multiple pages (animation frames) added main.title argument tm_layout added tmap_options, including new option tmap.unit (“metric” “imperial”“) improved automatic labeling breaks improved legend view mode: missing values shown default (like plot mode) improved bubble scaling view mode fixed bug aspect ratio bug","code":""},{"path":"/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 rmarkdown fixed bug qtm called without arguments","code":""},{"path":"/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":"/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":"/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 (tnx Sebastian!) [!] reverse geocoding function rev_geocode_OSM added [!] tm_logo added added popup.vars base layer functions bounding box (argument bbox tm_shape) working view mode geocode_OSM improved: SpatialPointsDataFrame can now returned last_map 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_rasters added support custom legend formating 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_ratio bug","code":""},{"path":"/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 boundig box now consistent Eurostat publications added crop_shape, convenient wrapper around raster::crop","code":""},{"path":"/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 improved set_projection raster objects added double_line offset_line added insets option save_tmap improved default settings contrast arugment regarding seq div palettes improved automatic positions legend map attributes (specifically, legend snaps righthand-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":"/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":"/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 added bb, handy bounding box function added layout themes tm_style tm_format added automatic text labeling added interactive SVG, can opend RStudio (see itmap) added map compass (tm_compass) added text aesthetics size col added automatic map coloring added earth boundary, useful projected world maps 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":"/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":"/news/index.html","id":"tmap-08","dir":"Changelog","previous_headings":"","what":"tmap 0.8","title":"tmap 0.8","text":"added tm_raster improved legend behaviour: legend titles set layer functions (instead tm_layout) removed crop_shape, since raster::crop job, , faster --scope functions migrated spatialToolbox package, available github.com/mtennekes/spatialToolbox","code":""},{"path":"/news/index.html","id":"tmap-071","dir":"Changelog","previous_headings":"","what":"tmap 0.7.1","title":"tmap 0.7.1","text":"fixed big scale parameter (global scale set tm_layout)","code":""},{"path":"/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 blubbles improved temp file handling animation_tmap added functions get set polygon directions, calculate intersection ratios polygons (intersection_shapes)","code":""},{"path":"/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/mtennekes/tmap get started, see package vignette ‘tmap nutshell’ help files questions suggestions, please contact (mtennekes gmail dot com)","code":""}]
+[{"path":"/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":"/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":"/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”: (haven’t decided whether include tm_cartogram tmap package extension package, e.g., tmapCartogram tmapExtra. Let us know opinion https://github.com/r-tmap/tmap/issues/565)","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 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 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":"/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":"/articles/tmap_sneak_peek.html","id":"multivarite-scales","dir":"Articles","previous_headings":"","what":"Multivarite 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":"/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":"/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":"/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":"/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":"/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 colomn. 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":"/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":"/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":"/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 panel 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":"/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":"/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":"/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 visual variable \"fill\" : \"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":"/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 gplot2 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, ggplot(), spatial class requires custom map layer function, e.g. geom_sf() sf objects. tmap static plot mode interactive mode. …","code":""},{"path":"/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":"/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":"/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":"/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\") 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":"/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":"tm_shape(World, crs = 8857) + tm_cartogram(size = \"pop_est\", fill = \"income_grp\") ## Cartogram in progress... ## Loading required namespace: cartogram ## 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":"/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":"/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":"/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":"/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":"/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":"/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":"/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Thematic Maps","text":"","code":"library(tmap)"},{"path":"/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":"/index.html","id":"vignettes","dir":"","previous_headings":"","what":"Vignettes","title":"Thematic Maps","text":"tmap v3: get started! tmap: changed recent versions?","code":""},{"path":"/index.html","id":"tutorials","dir":"","previous_headings":"","what":"Tutorials","title":"Thematic Maps","text":"tmap RMarkdown","code":""},{"path":"/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":"/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 visualising spatial data R Blog post StatialControl Blog post TWIAV Computer World: Create maps R 10 (fairly) easy steps Computer World: Great R packages data import, wrangling visualization Tutorial Visualising spatial data: base shiny - workshop Stack Overflow questions (#tmap)","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/land.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of global land cover — land","text":"","code":"land"},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/metro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of metropolitan areas — metro","text":"","code":"metro"},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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-element()s. Without arguments search term, functions draws interactive map.","code":""},{"path":"/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":"/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. OSM 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 seperately 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. Arugment 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":"/reference/qtm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quick thematic map plot — qtm","text":"tmap-element()","code":""},{"path":"/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-element()s 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":"/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":"/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":"/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":"/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":"/reference/rivers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatial data of rivers — rivers","text":"","code":"rivers"},{"path":"/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":"/reference/rivers.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Spatial data of rivers — rivers","text":"https://www.naturalearthdata.com","code":""},{"path":"/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":"/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":"/reference/shapeTM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Internal tmap function to create a tmap shape — shapeTM","text":"shp shp tmapID tmapID bbox bbox","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/tm_basemap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Map layer: basemap / overlay tiles — tm_basemap","text":"","code":"tm_basemap() + tm_shape(World) + tm_polygons(\"HPI\") #> Loading required namespace: maptiles tm_basemap(\"OpenTopoMap\") + tm_shape(World) + tm_polygons(fill = NA, col = \"black\")"},{"path":"/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":"/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":"/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 ... passd tm_polygons()","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 deceprated Please use tm_facets_page() ... paseed tm_facets()","code":""},{"path":"/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 acording coordinate system (master) shape object. Latitude longitude graticules drawn tm_graticules().","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/tm_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Legend — tm_legend","title":"Legend — tm_legend","text":"Legend specification","code":""},{"path":"/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":"/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":"/reference/tm_legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Legend — tm_legend","text":"OUTPUT_DESCRIPTION","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/tm_mv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"define multivariate variable — tm_mv","text":"","code":"tm_mv(...)"},{"path":"/reference/tm_mv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"define multivariate variable — tm_mv","text":"... variable names","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 colours 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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/reference/tm_scale.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Scales: automatic scale — tm_scale","text":"","code":"tm_scale(...)"},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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, 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. 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":"/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":"/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":"/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, 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 label.format (generic scale argument) Label formatting (similar legend.format tmap3) ... passed tm_scale_continuous","code":""},{"path":"/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":"/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":"/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, 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 label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"/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":"/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":"/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, 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 label.format (generic scale argument) Label formatting (similar legend.format tmap3)","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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_sneek_peek\") short introduction examples.","code":""},{"path":[]},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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":[]},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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":"/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 classIntervals grid labels specification per axis fixed bug geometry collection","code":""},{"path":"/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":"/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":"/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":"/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":"/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":"/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":"/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 xxx_tmap functions (e.g. save_tmap) tmap_xxx 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":"/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":"/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":"/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 NA’s 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":"/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 (required leaflet 1.1.0) added along argument tm_facets, enables facetting along multiple pages (animation frames) added main.title argument tm_layout added tmap_options, including new option tmap.unit (“metric” “imperial”“) improved automatic labeling breaks improved legend view mode: missing values shown default (like plot mode) improved bubble scaling view mode fixed bug aspect ratio bug","code":""},{"path":"/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 rmarkdown fixed bug qtm called without arguments","code":""},{"path":"/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":"/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":"/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 (tnx Sebastian!) [!] reverse geocoding function rev_geocode_OSM added [!] tm_logo() added added popup.vars base layer functions bounding box (argument bbox tm_shape) working view mode 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_rasters added support custom legend formating 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_ratio bug","code":""},{"path":"/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 boundig box now consistent Eurostat publications added crop_shape, convenient wrapper around raster::crop","code":""},{"path":"/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 improved set_projection raster objects added double_line offset_line added insets option save_tmap improved default settings contrast arugment regarding seq div palettes improved automatic positions legend map attributes (specifically, legend snaps righthand-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":"/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":"/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 added bb, handy bounding box function added layout themes tm_style tm_format added automatic text labeling added interactive SVG, can opend RStudio (see itmap) added map compass (tm_compass) added text aesthetics size col added automatic map coloring added earth boundary, useful projected world maps 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":"/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":"/news/index.html","id":"tmap-08","dir":"Changelog","previous_headings":"","what":"tmap 0.8","title":"tmap 0.8","text":"added tm_raster improved legend behaviour: legend titles set layer functions (instead tm_layout) removed crop_shape, since raster::crop job, , faster --scope functions migrated spatialToolbox package, available github.com/mtennekes/spatialToolbox","code":""},{"path":"/news/index.html","id":"tmap-071","dir":"Changelog","previous_headings":"","what":"tmap 0.7.1","title":"tmap 0.7.1","text":"fixed big scale parameter (global scale set tm_layout)","code":""},{"path":"/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 blubbles improved temp file handling animation_tmap added functions get set polygon directions, calculate intersection ratios polygons (intersection_shapes)","code":""},{"path":"/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":""}]