tmap_CreateMap: Create a complete 'tmap' map from an 'sf' dataframe...

View source: R/tmap_CreateMap.R

tmap_CreateMapR Documentation

Create a complete tmap map from an sf dataframe representing ROMS model output

Description

Function to create a complete tmap map layer from an sf dataframe representing ROMS model output.

Usage

tmap_CreateMap(
  sf_dfr,
  col = 4,
  n = 10,
  style = ifelse(is.null(breaks), "pretty", "fixed"),
  breaks = NULL,
  palette = c("blue", "red"),
  basemap = NULL,
  aes.palette = list(cat = c("blue", "red"), div = c("blue", "red"), seq = c("blue",
    "red")),
  showMap = FALSE
)

Arguments

sf_dfr

- an sf polygon dataframe.

col

- name or index of values column to plot

n

- preferred number of classes.

style

- method to process the color scale.

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, a vector of colors, or NULL. See tmaptools::palette_explorer() for the named palettes. Use a "-" as prefix to reverse the palette. The default palette is taken from the basemap (tm_layout's argument aes.palette).

basemap

- basemap for map, or name associated with a pre-defined basemap (see createBasemap).

aes.palette

- a list (with elements 'cat', 'div', 'seq') of palette names or a vector of colors for the basemap.

showMap

- flag to print map

Details

Creates a tmap map (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.

Discrete options for style 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 for style 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.

Value

A tmap map (bsaemap + shape/fill combination map layer) with polygons colored using the palette to represent values of the ROMS variable in sf_dfr.


wStockhausen/wtsROMS documentation built on Feb. 2, 2025, 9:16 p.m.