plotdap: Visualize rerddap data

View source: R/plotdap.R

plotdapR Documentation

Visualize rerddap data

Description

Visualize data returned from rerddap servers. Use plotdap() to initialize a plot, specify the plotting method (specifically, 'base' or 'ggplot2'), and set some global options/parameters. Then use add_tabledap() and/or add_griddap() to add "layers" of actual data to be visualized.

Usage

plotdap(
  method = c("ggplot2", "base"),
  mapData = maps::map("world", plot = FALSE, fill = TRUE),
  crs = NULL,
  datum = sf::st_crs(4326),
  mapTitle = NULL,
  mapFill = "gray80",
  mapColor = "gray90",
  ...
)

Arguments

method

the plotting method. Currently ggplot2 and base plotting are supported.

mapData

an object coercable to an sf object via st_as_sf().

crs

a coordinate reference system: integer with the epsg code, or character with proj4string.

datum

crs that provides datum to use when generating graticules. Set to NULL to hide the graticule.

mapTitle

a title for the map.

mapFill

fill used for the map.

mapColor

color used to draw boundaries of the map.

...

arguments passed along to geom_sf() (if method='ggplot2', otherwise ignored).

Details

The "ggplot2" method is slower than "base" (especially for high-res grids/rasters), but is more flexible/extensible. Additional ggplot2 layers, as well as scale defaults, labels, theming, etc. may be modified via the add_ggplot() function. See the mapping vignette for an introduction and overview of rerddap's visualization methods – browseVignettes(package = "rerddap").

Value

A plotdap object

Author(s)

Carson Sievert

See Also

tabledap(), griddap()

Examples


# base plotting tends to be faster (especially for grids),
# but is less extensible plotdap("base")

 plotdap()
 plotdap("base")



ropensci/plotdap documentation built on Oct. 23, 2023, 6:29 p.m.