| tmap_mode | R Documentation |
tmap_mode() gets (no argument) or sets the current mode.
ttm() toggles between the two most recent modes.
ttmp() same as ttm(), then calls tmap_last().
rtm() rotates through all modes in the pool.
rtmp() same as rtm(), then calls tmap_last().
tmap_mode_pool() restricts which modes are cycled by ttm() and rtm().
Call without arguments to inspect the current pool, or pass NULL to reset.
It is recommended to use tmap_mode() in scripts and ttm()/ttmp() in the console.
tmap_mode(mode = NULL, silent = FALSE)
ttm()
rtm()
tmap_mode_pool(modes = NULL, silent = FALSE)
ttmp()
rtmp()
mode |
A string specifying the mode. See |
silent |
Should the mode be switched silently? Default |
modes |
Character vector of mode names (minimum 2), or |
The default modes are "plot" (static, graphics device) and "view" (interactive,
browser or RStudio Viewer). Additional modes such as "maplibre" and "mapbox" become
available when tmap.mapgl is loaded.
tmap_mode() returns the current mode invisibly when called without argument,
otherwise the previous mode.
ttm(), rtm() return the previous mode invisibly.
tmap_mode_pool() returns the previous pool invisibly.
Tennekes, M., 2018, tmap: Thematic Maps in R, Journal of Statistical Software, 84(6), 1-39, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v084.i06")}
.doc_see_also_modes()
tmap_last() to show the last map
tm_view() for viewing options
tmap_leaflet() for obtaining a leaflet widget
tmap_options() for tmap options
current.mode = tmap_mode()
tmap_mode("plot")
tm_shape(World) + tm_polygons("HPI")
tmap_mode("view")
tm_shape(World) + tm_polygons("HPI")
ttm()
tm_shape(World) + tm_polygons("HPI")
tmap_mode(current.mode)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.