Replace NA with 0 in most frequent contact SMS metric

pull/95/head
JulioV 2020-03-12 11:22:31 -04:00
parent ed5d938316
commit 23085aac2a
1 changed files with 3 additions and 0 deletions

View File

@ -44,4 +44,7 @@ for(metric in metrics){
features <- merge(features, feature, by="local_date", all = TRUE)
}
if("countmostfrequentcontact" %in% metrics)
features <- features %>% mutate_at(vars(contains('countmostfrequentcontact')), funs(ifelse(is.na(.), 0, .)))
write.csv(features, snakemake@output[[1]], row.names = FALSE)