View source: R/tmap_CreateLayer.R
tmap_CreateLayer | R Documentation |
sf
dataframe representing a model outputFunction to create a tmap-style map layer from an sf
dataframe representing a model output.
tmap_CreateLayer(
sf_dfr,
col = 4,
n = 10,
style = ifelse(is.null(breaks), "pretty", "fixed"),
breaks = NULL,
palette = c("blue", "red")
)
sf_dfr |
- |
col |
- name or index of values column to plot |
n |
- preferred number of classes. |
style |
- method to process the color scale. Discrete options are "fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", and "log10_pretty". For discrete options (except "log10_pretty"), see the details in tmap::classIntervals. Continuous options are "cont", "order", and "log10". The first maps the values of col to a smooth gradient, the second maps the order of values of col to a smooth gradient, and the third uses a logarithmic transformation. |
breaks |
- in case style=="fixed", breaks should be specified. The breaks argument can also be used when style="cont". In that case, the breaks are mapped evenly to the sequential or diverging color palette. |
palette |
- a palette name or a vector of colors. See tmaptools::palette_explorer() for the named palettes. Use a "-" as prefix to reverse the palette. The default palette is taken from tm_layout's argument aes.palette. |
Creates a tmap-style shape/fill combination map layer with polygons colored using the palette
to represent values of the ROMS variable in sf_dfr
. If not provided, the palette will default to the
palette associated with the basemap used to plot the layer.
A tmap-style shape/fill combination map layer with polygons colored using the palette
to represent values of the ROMS variable in sf_dfr
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.