Closed rabutler closed 6 years ago
May want to re-structure how the getData and aggregate data works. could:
[x] 1. get the Data from rdf and turn it into a long table - identical to the table
generated by RiverWare/RiverSMART (see #30 rw_rdf_to_tbl()
)
[x] 2. then call aggregation methods after that. This ensures that the same aggregation code would work whether you are starting with rdf files or the csv file from RW
CY()
, WY()
, none
, EOCY
, EOWY
, specific month, or custom function. Then you could write a custom function, e.g., summer()
which filters only June, July, August.
add_ym_to_rdftbl()
min
, max
, sum
, none
na.rm = TRUE
for mean, etc. (I think getDataForAllScens()
treats NA
as a 0. Check this. If it does always, then I guess we do that here too. Otherwise, maybe we edit the summary
column to be able to accept multiple functions, e.g., sum(na_to_zero())
, by separating with ;
, or maybe piping themgetDataForAllScens()
does treat NaN
s as 0s. For now, we will offer two options that are decided per call to rwtbl_aggregate()
: "0" or "error". The first treats NaN
s as 0s, and the second as errors.getDataForAllScens()
, adding a second character column adds 25% onto the size of the tbl; same is true for one with ~500,000 rows. So I think we should just store the slot agg matrix as an attribute in the tbl; then we can read how the variable was created if we want to.rwd_agg
[x] 3. See #50 for all of the different attributes we need to add to the rwtblsmmry
[x] 4. New version of getDataForAllScens()
that calls rwtbl_aggregate()
getDataForAllScens()
getDataForAllScens()
to rw_scen_aggregate()
rwtbl_aggregate()
also could apply to the netcdf, eventually (#57)
Might not need to do #14 if we do this first
tests
will check csv in #56
Right now, we combine the summary step and the comparison against a threshold, e.g., AnnMax, EOCYLTE, EOCYLT, etc. This results in having a lot of aggregation methods.
We could split this into two steps. Step 1, would be the aggregations, e.g., sum, max, min, raw. Step 1a would be either CY or WY. Step 2 would then be the summary, e.g., <, <=, >, >=, !=, ==, NA.