

R for Fun Club (RFC)
Do you want to learn R Programming with other lazy coders? This is your group. We also didn’t... View more
How do I drop all NA’s in this code?
-
How do I drop all NA’s in this code?
Good evening
I’m struggling to remove missing values from my dataset. I want to draw a bar graph without NA.
Ebola <- rio::import(“linelist_raw.xlsx”)
glimpse(Ebola)
Ebola$age <- as.integer(Ebola$age)
Ebola%>%
select(age,outcome)%>%
drop_na(age,outcome)
Ebola$age_group <- cut(Ebola$age, c(0,9,19,29,39,49,59,69,79,80,Inf),
c(“0-9″,”10-19″,”20-29″,”30-39″,”40-49″,”50-59″,”60-69”,
“70-79″,”80-89″,”90+”),include.lowest = TRUE)
Ebola%>%
ggplot(aes(age_group,fill = outcome))+
geom_bar(position = “dodge”)
Log in to reply.