1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 15:01:51 +02:00

freq header fix for NAs

This commit is contained in:
2018-12-14 10:08:51 +01:00
parent e4737d3add
commit dec4947103
2 changed files with 2 additions and 1 deletions

View File

@ -316,7 +316,7 @@ frequency_tbl <- function(x,
}
}
if (NROW(x) > 0) {
if ((length(NAs) + length(x) > 0) > 0) {
na_txt <- paste0(NAs %>% length() %>% format(decimal.mark = decimal.mark, big.mark = big.mark), ' = ',
(NAs %>% length() / (NAs %>% length() + x %>% length())) %>% percent(force_zero = TRUE, round = digits, decimal.mark = decimal.mark) %>%
sub('NaN', '0', ., fixed = TRUE))