request_data | R Documentation |
Uses StreamPULSE API to query data via MySQL. Visit the data portal at https://data.streampulse.org to download data via a browser.
request_data(
sitecode,
startdate = NULL,
enddate = NULL,
variables = NULL,
token = NULL
)
sitecode |
underscore-separated region and site code, e.g. 'NC_Eno'.
Full list of regions and site codes available at
https://data.streampulse.org/sitelist. Or, you can use the
|
startdate |
date string formatted 'YYYY-MM-DD', representing the first
day of data to be requested.
If data coverage does not extend this far back in time, the argument
will be adjusted to the first day with available data. Omit this argument to
include all records up to the first available. To see the range of available
dates for a particular site, use the
|
enddate |
date string formatted 'YYYY-MM-DD', representing the last
day of data to be requested.
If data coverage does not extend this far in time, the argument
will be adjusted to the last day with available data. Omit this argument to
include all records up to the last available. To see the range of available
dates for a particular site, use the
|
variables |
character vector of variable names to request. To see which
variables are available for a given site, use the
|
token |
a unique alphanumeric string for each registered user of StreamPULSE. Only necessary for accessing embargoed data. |
Request data for a single region and site within the StreamPULSE database. All sites are embargoed for 1 year or more from the time they first appear in the database. Embargoed data are only available to the user who submits them, and can be accessed via a unique token.
returns a list
containing two data.frame
s.
The first contains all requested
data. The second contains site metadata. Variable names and corresponding
values are stacked in two long columns. Use prep_metabolism
to
format the output of this function.
Mike Vlah, vlahm13@gmail.com
Aaron Berdanier
prep_metabolism
for organizing data returned by this
function.
query_available_data(region='all')
streampulse_data = request_data(sitecode='NC_Eno',
startdate='2016-06-10', enddate='2016-10-23')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.