wrcc_createRawDataframe: Obtain WRCC data and parse into a tibble

Description Usage Arguments Value Note References See Also Examples

View source: R/wrcc_createRawDataframe.R

Description

Obtains monitor data from a WRCC webservice and converts it into a quality controlled, metadata enhanced "raw" tibble ready for use with all raw_~ functions.

Steps involved include:

  1. download CSV text

  2. parse CSV text

  3. apply quality control

  4. apply clustering to determine unique deployments

  5. enhance metadata to include: elevation, timezone, state, country, site name

Usage

1
2
3
4
5
wrcc_createRawDataframe(startdate = strftime(lubridate::now(),
  "%Y010100", tz = "UTC"), enddate = strftime(lubridate::now(),
  "%Y%m%d23", tz = "UTC"), unitID = NULL, clusterDiameter = 1000,
  baseUrl = "http://www.wrcc.dri.edu/cgi-bin/wea_list2.pl",
  saveFile = NULL, flagAndKeep = FALSE)

Arguments

startdate

Desired start date (integer or character representing YYYYMMDD[HH]).

enddate

Desired end date (integer or character representing YYYYMMDD[HH]).

unitID

Station identifier (will be upcased).

clusterDiameter

Diameter in meters used to determine the number of clusters (see addClustering).

baseUrl

Base URL for data queries.

saveFile

Optional filename where raw CSV will be written.

flagAndKeep

Flag, rather then remove, bad data during the QC process.

Value

Raw tibble of WRCC data.

Note

The downloaded CSV may be saved to a local file by providing an argument to the saveFile parameter.

Monitor unitIDs can be found at http://www.wrcc.dri.edu/cgi-bin/smoke.pl.

References

Fire Cache Smoke Monitoring Archive

See Also

wrcc_downloadData

wrcc_parseData

wrcc_qualityControl

addClustering

Examples

1
2
3
4
## Not run: 
tbl <- wrcc_createRawDataframe(20150701, 20150930, unitID='SM16')

## End(Not run)

MazamaScience/PWFSLSmoke documentation built on March 17, 2019, 9:27 p.m.