View source: R/raws_toRawsDF.R
raws_toRawsDF | R Documentation |
Converts a raws_timeseries object to a single, tidy
dataframe containing all varaibles from rawsObject$data
along with the
following values from rawsObject$meta
:
nwsID - the nwsID of the station
wrccID - the wrccID of the station
locationName - the name of the station
longitude - longitude coordinate of the station
latitude - latitude coordinate of the station
elevation - elevation of the station
timezone - timezone of the station
Additionally, this dataframe contains the following parameters of interest:
Vapor Pressure Deficit (VPD):
https://andrewsforest.oregonstate.edu/sites/default/files/lter/data/studies/ms01/dewpt_vpd_calculations.pdf
https://en.wikipedia.org/wiki/Clausius–Clapeyron_relation#Meteorology_and_climatology
Fosberg Fire Weather Index (FFWI):
https://a.atmos.washington.edu/wrfrt/descript/definitions/fosbergindex.html
This version of the RAWS data is known as a rawsDF object.
Replicating this set of variables for every record greatly inflates the size
of the data but also makes it much more useful when working with the
dplyr and ggplot2
packages.
Multiple rawsDF objects can be combined with dplyr::bind_rows()
and used to create multi-station plots.
raws_toRawsDF(rawsObject = NULL, sizeMax = 100)
rawsObject |
raws_timeseries object to convert. |
sizeMax |
Maximum allowable size (in MB) for the resulting dataframe. |
Tidy dataframe containing data and metadata.
Program for Climate, Ecosystem and Fire Applications
## Not run:
library(RAWSmet)
setRawsDataDir("~/Data/RAWS/")
stationMeta <- wrcc_loadMeta(stateCode = "WA")
rawsObject <- wrcc_loadYear(
wrccID = "waWENU",
meta = stationMeta,
year = 2020,
password = MY_PASSWORD
)
rawsDF <- raws_toRawsDF(rawsObject)
dplyr::glimpse(rawsDF)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.