plotdap: Visualize rerddap data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plotdap.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
# base plotting tends to be faster (especially for grids),
# but is less extensible plotdap("base")

 plotdap()
 plotdap("base")

plotdap documentation built on Oct. 29, 2020, 1:07 a.m.