View source: R/epa_aqs_createLocalArchive.R
epa_aqs_createLocalArchive | R Documentation |
Create a local archive of EPA AQS transofrmed into data appropriate for use with the MazamaTimeSeries package.
The data model is that data are stored in a tibble named data
with an initial
datetime
column and monitor-specific data in columns identified with a
deviceDeploymentID
that matches one found in the incoming meta
table.
Both data
and meta
will be saved as '.rda', '.csv' and '.csv.gz'
files for maximum portability to other languages like python, javascript or
even to desktop spreadsheet software.
The archive structure underneath archiveBaseDir
will be:
<archiveBaseDir>/EPA_AQS/<parameterCode>/<year>/
Files will be named as:
epa_aqs_<parameterCode>_<year>_meta.[rda|csv|csv.gz] epa_aqs_<parameterCode>_<year>_data.[rda|csv|csv.gz]
epa_aqs_createLocalArchive(
sites_locationTbl = NULL,
parameterCode = NULL,
years = NULL,
archiveBaseDir = NULL,
downloadDir = NULL,
quiet = FALSE
)
sites_locationTbl |
EPA AQS "known locations" table for |
parameterCode |
EPA "Parameter Code". |
years |
Vector of years for which to transform data. |
archiveBaseDir |
Path under which the directory structure will be created. |
downloadDir |
Directory in which to save downloaded EPA .zip files. If |
quiet |
Logical passed on to |
Returns 0 on success.
Depending on your internet connection speeds, downloading files from the EPA
site can take several minutes per file. If you see warning messages that you have
timed out, please download files manually before running this function. This
function will then discover the downloaded files in the downloadDir
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.