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)
raws_timeseries object to convert.
Maximum allowable size (in MB) for the resulting dataframe.
Tidy dataframe containing data and metadata.
if (FALSE) {
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)
}