Closed djhocking closed 9 years ago
The obs_freq function in the QAQC.R script should use
obs_freq
median_obs <- obs_per_day %>% #dplyr::mutate(series_id_alt = paste0(series_id, "-", "a")) %>% dplyr::group_by(series_id) %>% #dplyr::mutate(obs_per_day = ifelse(is.na(obs_per_day), NA_integer_, obs_per_day)) %>% dplyr::summarise(median_freq = median(obs_per_day, na.rm = T), min_n90 = median_freq*0.9)
but there is an bug in dplyr that prevents this for some datasets. See github issue: https://github.com/hadley/dplyr/issues/893
for now I will use the mean in place of the median but it should be change when dplyr is fixed.
https://github.com/hadley/dplyr/issues/893#issuecomment-91353361
This doesn't seem to happen if you multiply the median calculation by a float. The following works fine: summarise(median = median(x) * 1.0)
The
obs_freq
function in the QAQC.R script should usebut there is an bug in dplyr that prevents this for some datasets. See github issue: https://github.com/hadley/dplyr/issues/893
for now I will use the mean in place of the median but it should be change when dplyr is fixed.