How can I avoid NA columns in dcast() output from the reshape2 package?
NA
dcast()
reshape2
In this dummy example the dcast() o
library(dplyr) library(tidyr) iris %>% filter(!is.na(Species2)) %>% group_by(Species, Species2) %>% summarize(freq = n()) %>% spread(Species2, freq)