add_tabledap | R Documentation |
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, ... )
plot |
a plotdap object. |
table |
a tabledap object. |
var |
a formula defining a variable, or function of variables to visualize. |
color |
either a character string of length 1 matching a name in |
size |
the size of the symbol. |
shape |
the shape of the symbol. For valid options, see the 'pch' values
section on points. |
animate |
whether to animate over the |
cumulative |
- if animation should be cumulative -default FALSE |
... |
arguments passed along to |
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 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.