tmap_base: Interactive map base plot

Description Usage Arguments Value Examples

View source: R/tmap_base.R

Description

This function provides a basic interactive map. By default it contains three basemap layers: OpenStreet Maps streets, a global orthophoto, and a global terrain map. This is indended to get things started with an interactive map to which additional layers will be added by the user.

Usage

1

Arguments

data

Optional spatial data source containing the spatial information to be plotted in the interactive map.

Value

A tmap object with tmap_mode() set to view.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(tmap)
library(magrittr)

data('World', 'metro')

## Use the example world data to create an interactive map
tmap_base() +
  ## Add country polygons, colored by the Happy Planet Index
  tm_shape(World) +
  tm_polygons('HPI') +
  ## Add cities, sized proportional to population, with clustering
  tm_shape(metro) +
  tm_dots(
    size = 'pop2020',
    col = 'blue',
    clustering = TRUE)

tfullman/packr documentation built on Jan. 2, 2022, 12:16 a.m.