I am trying to visualize demographic data in a histogram.
I would like to have a histogram that has: -age groups (20-25, 25-30,...) -and for each age group two bars (female, male) with different colours (red, blue).
I tried many things, like creating separate dataframes for sex:
hist(dem.data.female$age,col="red"...)
hist(dem.data.male$age, col= "blue", add= T....)
I received a histogram but the bars overlayed each other... I also tried installing the easy.ggplot2 package but my R program seems not to have it.