You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be nice to have some convivence functions for converting the output from e.g. fetchSCAN() into the format used in batch mode. Mostly preservation of IDs, long → wide format, etc..
The text was updated successfully, but these errors were encountered:
I think this would be useful, though for jNSMR we would need to have SCAN/SNOTEL/CDEC data aggregated to a monthly timestep. I think we probably could customize a single function so generic ~daily data in long format can be put into the jNSM "batch CSV" format.
Sketching out one of these convenience functions:
A key focus for use in jNSMR would be aggregation from long format -> monthly data in wide format.
This aggregation would need to be aware of site ID, date (or at least month), and data/aggregation type (temperature v.s. precipitation).
Aggregation for temp v.s. precip will vary because temp is aggregated w/ the average, or some other measure of central tendency/distribution for the month, whereas the precip is summed within months for a specific year
Arguments to this function might include:
x (a data.frame in "long" format, containing observations of precipitation and/or temperature that need to have at least information on month+year for independent records)
site.id (site identifier column name)
date (date column name; column containing character or POSIX time used to extract year and month)
data_type (data type column name; character column containing "temperature" or "precipitation"),
FUN (optional custom function, defaults to mean() for data_type="temperature" and sum() for data_type="precipitation")
... (maybe explicit additional arguments related to date/formats, ... passed to FUN)
I think this function could be written such that it could deal with a wide range of time intervals converted to monthly. Range from very fine scale measurements on e.g. 10 minute intervals, to daily, to weekly, to one per month for one or more years should be possible.
Would be nice to have some convivence functions for converting the output from e.g.
fetchSCAN()
into the format used in batch mode. Mostly preservation of IDs, long → wide format, etc..The text was updated successfully, but these errors were encountered: