Default values for mapping functions
mapping.options.RdSet or retrieve default values used in mapping functions availables in mapping package.
Arguments
- ...
A single character vector, or a named list. The form
name = valuecan be used to change a single option orlist(name1 = value1, name2 = value2)can be used to change several arguments. If no arguments are provided, then the function returns all the current options.
Details
The function change globally the option for the current R session, and locally if used in the mapping function, with the options argument, for example, options = mapping.options(legend.frame = FALSE, "title.position" = "left").
Many different options are used for the function in tmap package. For more details, look at tm_layout, tm_borders, and tm_fill.
Available options are the following:
palette.cont = "YlGnBu"palette for countinuous data
palette.cat = "Accent"palette for categorical data
palette.cont.vector = NULLa string vector with color names for countinuous data
palette.cont.vector = NULLa string vector with color names for categorical data
nclass = 5number of classes for countinuous data
check.unit.names = TRUEa ogical value indicating whether the input id names are checked before the link with the coordinates
use_cache = TRUEa ogical value indicating whether the cache is used to load the shape file
use_internet = TRUEa ogical value indicating whether the data are downloaded from internet or whether a internet connection is available
alpha = 1transparency
breaks = NULLa numerical value indicating the breaks
interval.closure = "left"a ogical value indicating where the interval are closed
labels = NULLa character vector with labels of the classes
NA.color = "grey"color for
NAvaluesNA.text = "Missing"label for
NAvaluescol.style = "order"type of color scale for numeric data. For other method look ad
tm_fillmap.frame = TRUEa logical value indicating whether the frame is drawn
border.lwd = 1line width of the borders
border.col = "black"color of the borders
border.type = "solid"border type
border.alpha = NAtrasparency of the borders
title = NULLmain title
title.position = "center"main title position
title.color = "black"color of main title
title.fontface = 1main title font face
title.size = 1main title size
legend.title = NAtitle of the legend
legend.show = TRUEa logical value indicating whether include the legend
legend.only = FALSEa logical value indicating whether include the legend without map
legend.position = c("right","top")legend position
legend.digits = 5legend digits
legend.outside = FALSEa logical value indicating whether the legend is included outside the map
legend.outside.facetes = TRUEa logical value indicating whether the legend is included outside the facetes
legend.width = 1width of the legend
legend.title.position = c("right","top")legend title position
legend.title.size = 1legend title size
legend.title.fontface = 1legend title font space
legend.title.color = "black"legend title color
legend.text.color = "black"legend title color
legend.text.size = 0.5legend title color size
legend.text.align = "left"legend.text.fontface = 1legend.frame = TRUEa logical value indicating whether the frame is drawn for the legend
legend.decimal.mark = "."legend.format = "fg"legend.big.mark = ","legend.text.separator = "-"facets.free.scale = FALSEfacetes.cols = NAfacetes.rows = NAinteractive.tiles = "CartoDB.Positron"interactive.popup.vars = NULLinteractive.popup.id = TRUEinteractive.popup.closeButton = TRUEinteractive.popup.width.max = 150interactive.popup.width.min = 35interactive.highlight.weight = 3interactive.highlight.color = "black"interactive.highlight.alpha = 1interactive.highlight.front = TRUEinteractive.control.collapse = TRUEinteractive.layer.control.position = c("left", "top")interactive.hovered.id = TRUEtext.size = 0.5text.col = "black"text.fontface = 1text.shadow = FALSEtext.alpha = NAcredits.source = NULLcredits.author = NULLcredits.size = 0.7credits.fontface = NAcredits.color = "black"credits.align = "left"credits.position = c("left", "bottom")popup.vars = NAa character vector indicating the variable to popoup in interactive maps
compass = NULLa character vector indicatin the type of compass (look at
tm_layout)style = "white"style (look at
tm_style)crs = NULL
Options may be reset using mapping.options().
References
Tennekes M (2018). “tmap: Thematic Maps in R.” _Journalstatisticaltical Software_, *84*(6), 1-39. doi: 10.18637/jss.v084.i06 (URL: https://doi.org/10.18637/jss.v084.i06).
Examples
mapping.options()
#> $palette.cont
#> [1] "YlGnBu"
#>
#> $palette.cat
#> [1] "Accent"
#>
#> $nclass
#> [1] 5
#>
#> $check.unit.names
#> [1] TRUE
#>
#> $use_cache
#> [1] TRUE
#>
#> $use_internet
#> [1] TRUE
#>
#> $alpha
#> [1] 0.8
#>
#> $breaks
#> NULL
#>
#> $interval.closure
#> [1] "left"
#>
#> $labels
#> NULL
#>
#> $NA.color
#> [1] "grey"
#>
#> $NA.text
#> [1] "Missing"
#>
#> $col.style
#> [1] "cont"
#>
#> $map.frame
#> [1] FALSE
#>
#> $border.lwd
#> [1] 0.5
#>
#> $border.col
#> [1] "black"
#>
#> $border.type
#> [1] "solid"
#>
#> $border.alpha
#> [1] 0.8
#>
#> $title
#> NULL
#>
#> $title.position
#> [1] "left"
#>
#> $title.color
#> [1] "black"
#>
#> $title.fontface
#> [1] 1
#>
#> $title.size
#> [1] 1
#>
#> $legend.title
#> [1] NA
#>
#> $legend.show
#> [1] TRUE
#>
#> $legend.only
#> [1] FALSE
#>
#> $legend.position
#> [1] "right" "top"
#>
#> $legend.portrait
#> [1] TRUE
#>
#> $legend.digits
#> [1] 3
#>
#> $legend.outside
#> [1] FALSE
#>
#> $legend.outside.facetes
#> [1] FALSE
#>
#> $legend.width
#> [1] 0.7
#>
#> $legend.title.position
#> [1] "right" "top"
#>
#> $legend.title.size
#> [1] 0.7
#>
#> $legend.title.fontface
#> [1] 1
#>
#> $legend.title.color
#> [1] "black"
#>
#> $legend.text.color
#> [1] "black"
#>
#> $legend.text.size
#> [1] 0.7
#>
#> $legend.text.align
#> [1] "left"
#>
#> $legend.text.fontface
#> [1] 1
#>
#> $legend.frame
#> [1] FALSE
#>
#> $legend.decimal.mark
#> [1] "."
#>
#> $legend.format
#> [1] "fg"
#>
#> $legend.big.mark
#> [1] ","
#>
#> $legend.text.separator
#> [1] "-"
#>
#> $facets.free.scale
#> [1] FALSE
#>
#> $facetes.cols
#> [1] NA
#>
#> $facetes.rows
#> [1] NA
#>
#> $interactive.tiles
#> [1] "CartoDB.Positron"
#>
#> $interactive.popup.vars
#> NULL
#>
#> $interactive.popup.id
#> [1] TRUE
#>
#> $interactive.popup.closeButton
#> [1] TRUE
#>
#> $interactive.popup.width.max
#> [1] 150
#>
#> $interactive.popup.width.min
#> [1] 35
#>
#> $interactive.highlight.weight
#> [1] 3
#>
#> $interactive.highlight.color
#> [1] "black"
#>
#> $interactive.highlight.alpha
#> [1] 1
#>
#> $interactive.highlight.front
#> [1] TRUE
#>
#> $interactive.control.collapse
#> [1] TRUE
#>
#> $interactive.layer.control.position
#> [1] "left" "top"
#>
#> $interactive.hovered.id
#> [1] TRUE
#>
#> $text.size
#> [1] 0.5
#>
#> $text.col
#> [1] "black"
#>
#> $text.fontface
#> [1] 1
#>
#> $text.shadow
#> [1] FALSE
#>
#> $text.alpha
#> [1] NA
#>
#> $credits.source
#> NULL
#>
#> $credits.author
#> NULL
#>
#> $credits.size
#> [1] 0.7
#>
#> $credits.fontface
#> [1] NA
#>
#> $credits.color
#> [1] "black"
#>
#> $credits.align
#> [1] "left"
#>
#> $credits.position
#> [1] "left" "bottom"
#>
#> $background.color
#> [1] "grey85"
#>
#> $popup.vars
#> [1] NA
#>
#> $compass
#> NULL
#>
#> $style
#> [1] "white"
#>
#> $crs
#> [1] "+init=epsg:4326"
#>
# A single options
mapping.options("title.position")
#> [1] "left"
# Globally
mapping.options("title.position" = "left")
mapping.options("title.position")
#> [1] "left"