Relative Content

Tag Archive for rdataframeggplot2nullgeom-bar

How to display a category with zero observations in my barplot using ggplot() geom(bar

I’m trying to create a barplot showing the relative percentages in age categories within group (event location).
I have one category that is not present in my observations (younger than 18 years old, namely category 1). I’ve tried it with “drop=FALSE”, see:
scale_x_discrete(breaks=c(“1”, “2”,”3″,”4″,”5″,”6″), labels=vec.age_cat, drop=FALSE).