Learn R Programming

tmap (version 1.11)

tmap_options: Options for tmap

Description

Get or set global options for tmap. The behaviour is similar to options: all tmap options are retrieved when this function is called without arguments. When arguments are specified, the corresponding options are set, and the old values are silently returned.

Usage

tmap_options(...)

Arguments

...

tmap options, using name = value. See below for the available tmap options. Alternatively, a named list can be provided.

Details

The following tmap options exist:

tmap.unit

This is the default value for the unit argument of tm_shape. It specifies the unit of measurement, which is used in the scale bar and the calculation of density values. By default (when loading the package), it is "metric". Other valid values are "imperial", "km", "m", "mi", and "ft".

tmap.style

This option determines the current style. See tmap_style for details.

tmap.mode

This options determines the current mode. See tmap_mode for details.

tmap.limits

This option determines how many facets (small multiples) are allowed for per mode. It should be a vector of two numeric values named facets.view and facets.plot. By default (i.e. when loading the package), it is set to c(facets.view = 4, facets.plot = 64)

See Also

tmap_mode, tmap_style

Examples

Run this code
# NOT RUN {
# save current options
current_options <- tmap_options()

# show current options
tmap_options()

# switch to other view
ttm()

# show current options
tmap_options()

# set style to cobalt
tmap_options(tmap.style = "cobalt")

# show current options
tmap_options()

# set style usign tmap_style
tmap_style("classic")

# show current options
tmap_options()

# set unit to imperial
tmap_options(tmap.unit = "imperial", tmap.limits = c(facets.view = 8, facets.plot = 16))

# show current options
tmap_options()

# restore options
tmap_options(current_options)
# }

Run the code above in your browser using DataLab