Closed krpaulson closed 3 years ago
This should have been closed with #54 when the na_value_severity
argument was added.
#' **`na_value_severity`**:
#'
#' Check for 'NA' values in the `value_cols`.
#' 1. `stop`: throw error (this is the default).
#' 2. `warning` or `message`: throw warning/message, drop missing values and
#' continue with aggregation/scaling where possible (this likely will cause
#' another error because of `missing_dt_severity`, consider setting
#' `missing_dt_severity = "skip"` for functionality similiar to `na.rm = TRUE`).
#' 3. `none`: don't throw error or warning, drop missing values and continue
#' with aggregation/scaling where possible (this likely will cause another error
#' because of `missing_dt_severity`, consider setting
#' `missing_dt_severity = "skip"` for functionality similiar to `na.rm = TRUE`).
#' 4. `skip`: skip this check and propagate `NA` values through
#' aggregation/scaling.
Is your feature request related to a problem? Please describe. It would be useful to add a
na_rm
option to aggregation.Here's an example where I would like non-NA sums in the aggregated output:
Describe the solution you'd like Add a
na.rm = T
option toagg
function.Describe alternatives you've considered Make
missing_dt_severity
flexible enough to accommodate this option. Perhaps add "remove" as a valid entry formissing_dt_severity
?Additional context A possible work-around is for users to remove or interpolate NAs prior to aggregation. Especially since it isn't great form to be ignoring NAs in interval aggregation like this. But right now the "missing_dt_severity = 'none'" option is misleading... my quick interpretation of it was that it would sum up non-NA values.