bigvis
bigvis copied to clipboard
`weighted.median(NA, na.rm=T)` returns `logical(0)`, expected `NA_real_`
I'd propose that weighted.median
function returns NA_real_
instead of logical(0)
, when all x
are NAs:
weighted.median(NA, 1, na.rm=T) # returns `logical(0)`
The problem with logical(0)
output is that calculating weighted mean summaries by group causes an error when using dplyr::group_by
and dplyr::summarise
## Column 2 of result for group 2 is type 'double' but expecting type 'logical'. Column types must be consistent for each group.