BoulderCodeHub / RWDataPlyr

R package to read and manipulate data from RiverWareTM
3 stars 5 forks source link

How to treat NaNs in rwtbl_aggregate() #71

Open rabutler opened 6 years ago

rabutler commented 6 years ago

Currently, NaNs in a rwtbl can either be treated as 0s or errors, and this is a "global" decision for each call to rwtbl_aggregate().

0 replicates getDataForAllScens() logic, and "error" allows us to identify NaNs as erroneous, but perhaps there is another way to treat them on a per-slot basis. In #51 we stated the following, but decided on the above logic:

how to specify 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 them