harmonized variable names
jonathancallahan opened this issue · 0 comments
One of the main goals of several of the packages produced by Mazama Science is the creation of compact, understandable, standardized data structures.
The "raws timeseries object" needs to contain two standardized data frames: meta
for metadata and data
for timeseries data.
These data frames need to have a minimum shared set of variables in the same order whether they came from "fw13" or "wrcc". For meta
we currently have:
> names(fw13_meta)
[1] "nwsID" "wrccID" "nessID" "siteName" "longitude"
[6] "latitude" "timezone" "elevation" "countryCode" "stateCode"
[11] "agency"
> names(wrcc_meta)
[1] "nwsID" "wrccID" "nessID" "siteName" "longitude"
[6] "latitude" "timezone" "elevation" "countryCode" "stateCode"
[11] "agency"
so we look good on that front.
For data
we currently have:
> names(fw13$data)
[1] "datetime" "temperature" "humidity"
[4] "fuelMoisture" "windSpeed" "windDirection"
[7] "maxGustSpeed" "maxGustDirection" "precipitation"
[10] "solarRadiation" "minHumidity" "maxHumidity"
[13] "precipDuration"
> names(wrcc$data)
[1] "datetime" "AvAirTemp" "RelHumidty" "WindSpeed"
[5] "WindDirec" "MxGustSpeed" "DirMxGust" "Precip"
[9] "SolarRad" "BatteryVoltage" "FuelTemp" "AvFuelMoistr"
Let's drop min/maxHumidity as I think these are daily mins and max.
Let's settle on the following list of guaranteed data
variables in order:
standardDataVars <- c(
"datetime", "temperature", "humidity",
"windSpeed", "windDirection", "maxGustSpeed", "maxGustDirection",
"precipitation", "solarRadiation",
"fuelMoisture", "fuelTemperature"
)
If people need to work with other variables, they can work with the ~RawDataframe()
functions.
Within WRCC data, we already have a lower level of consistency guaranteeing that all WRCC data has a shared set of variables.
This task has three parts:
- update
fw13_createTimeseriesObject()
to drop min/max humidity and guarantee the existence and ordering ofstandardDataVars
. - update
wrcc-createTimeseriesObject()
to guarantee the existence and ordering ofstandardDataVars
- review the code base to update anything that depends on the previous names