Learn R Programming

tmap (version 4.0)

tmap_leaflet: Export tmap to the format of the used graphics mode

Description

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

  • tmap_leaflet() a leaflet object ("view" mode).

Usage

tmap_leaflet(x, show = FALSE, ...)

tmap_grob(x, asp = NA, scale = 1, show = FALSE, ...)

Value

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

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

Arguments

x

a tmap object.

show

show the map?

...

Arguments passed on to print.tmap

return.asp

should the aspect ratio be returned?

vp

viewport (for "plot" mode)

knit

A logical, should knit?

in.shiny

A logical, is the map drawn in shiny?

proxy

A logical, if in.shiny, is tmapProxy() used?

options

A vector of options

asp, scale

the desired aspect ratio and scale of the map. Only applicable for "plot" mode.

Examples

Run this code
map = tm_shape(World) + tm_polygons()
tmap_leaflet(map, show = TRUE)

Run the code above in your browser using DataLab