tm_scale_intervals | R Documentation |
Scales in tmap are configured by the family of functions with prefix tm_scale
.
Such function should be used for the input of the .scale
arguments in the
layer functions (e.g. fill.scale
in tm_polygons()
).
The function tm_scale_intervals()
is used for numerical data.
tm_scale_intervals(
n = 5,
style = ifelse(is.null(breaks), "pretty", "fixed"),
style.args = list(),
breaks = NULL,
interval.closure = "left",
midpoint = NULL,
as.count = FALSE,
values = NA,
values.repeat = FALSE,
values.range = NA,
values.scale = NA,
value.na = NA,
value.null = NA,
value.neutral = NA,
labels = NULL,
label.na = NA,
label.null = NA,
label.format = list()
)
n |
Number of intervals. For some styles (see argument |
style |
Method to create intervals. Options are |
style.args |
List of extra arguments passed on to |
breaks |
Interval breaks (only used and required when |
interval.closure |
value that determines whether where the intervals are closed: |
midpoint |
The data value that is interpreted as the midpoint. By default it is set to 0 if negative and positive values are present. Useful when values are diverging colors. In that case, the two sides of the color palette are assigned to negative respectively positive values. If all values are positive or all values are negative, then the midpoint is set to |
as.count |
Should the data variable be processed as a count variable? For instance, if |
values |
(generic scale argument) The visual values. For colors (e.g. |
values.repeat |
(generic scale argument) Should the values be repeated in case there are more categories? |
values.range |
(generic scale argument) Range of the values. Vector of two numbers (both between 0 and 1) where the first determines the minimum and the second the maximum. Full range, which means that all values are used, is encoded as |
values.scale |
(generic scale argument) Scaling of the values. Only useful for size-related visual variables, such as |
value.na |
(generic scale argument) Value used for missing values. See tmap option |
value.null |
(generic scale argument) Value used for NULL values. See tmap option |
value.neutral |
(generic scale argument) Value that can be considered neutral. This is used for legends of other visual variables of the same map layer. E.g. when both |
labels |
(generic scale argument) Labels |
label.na |
(generic scale argument) Label for missing values |
label.null |
(generic scale argument) Label for null (out-of-scope) values |
label.format |
(generic scale argument) Label formatting (similar to legend.format in tmap3) |
tm_scale()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.