add_tabledap
adds the data from an 'rerddap::tabledap()' call to
a 'plotdap' map
add_tabledap(
plot,
table,
var,
color = c("#132B43", "#56B1F7"),
size = 1.5,
shape = 19,
animate = FALSE,
cumulative = FALSE,
...
)
a plotdap object.
a tabledap object.
a formula defining a variable, or function of variables to visualize.
either a character string of length 1 matching a name in cmocean
or a vector of color codes. This defines the colorscale used to encode values
of var
.
the size of the symbol.
the shape of the symbol. For valid options, see the 'pch' values
section on points. plot(0:25, 0:25, pch = 0:25)
also gives a
quick visual of the majority of possibilities.
whether to animate over the time
variable (if it exists).
Currently only implemented for method='ggplot2'
and requires the
gganimate package.
- if animation should be cumulative -default FALSE
arguments passed along to geom_sf()
(if method='ggplot2'
, otherwise ignored).
A plotdap object
# base plotting tends to be faster,
# but is less extensible plotdap("base")
# test datasets in data folder to meet execution timings
# code given to extract the data
# \donttest{
sardines <- rerddap::tabledap(
'FRDCPSTrawlLHHaulCatch',
fields = c('latitude', 'longitude', 'time', 'scientific_name', 'subsample_count'),
'time>=2010-01-01', 'time<=2012-01-01',
'scientific_name="Sardinops sagax"'
)
# }
p <- plotdap()
p1 <- add_tabledap(p, sardines, ~subsample_count)
p2 <- add_tabledap(p, sardines, ~log2(subsample_count))
# using base R plotting
p <- plotdap("base")
p <- add_tabledap(p, sardines, ~subsample_count)
# robinson projection
p <- plotdap(crs = "+proj=robin")
p <- add_tabledap(p, sardines, ~subsample_count)