Further to my recent post on this topic and thanks to help received already (thanks BTW), I've got back-to-back plots working nicely to give me population pyramids, with some overlaid point data from a different time period, using the code below.
#packages
library(ggplot2)
library(reshape2)
library(plyr)
#sample data
set.seed(33)
df<-data.frame(ag=c(1:18),males_year1=sample(100:200,18),females_year1=sample(100:200,18),males_year2=sample(100:200,18),females_year2=sample(100:200,18))
#melt the data set
df<-data.frame(melt(df,id="ag"))
df
#here is the plot
p<-ggplot(df)+
geom_bar(subset=.(df$variable=="males_year1"),stat="identity",aes(x=ag,y=value),fill="#6666FF")+
geom_bar(subset=.(df$variable=="females_year1"),stat="identity",aes(x=ag,y=-value),fill="#FF9333")+
geom_point(subset=.(df$variable=="males_year2"),stat="identity",aes(x=ag,y=value),size=3,colour="#330099")+
geom_point(subset=.(df$variable=="females_year2"),stat="identity",aes(x=ag,y=-value),size=3,colour="#CC3300")+
coord_flip()+
theme_bw()+
scale_y_continuous(limits=c(-200,200),breaks=seq(-200,200,50),labels=abs(seq(-200,200,50)))+
scale_x_continuous(limits=c(0,19),breaks=seq(1,18,1),labels=abs(seq(1,18,1)))+
xlab("age group")+ylab("population")+
theme_bw()+
xlab("age group")+
ylab("population")+
geom_text(y=-100,x=19.2,label="Females")+
geom_text(y=100,x=19.2,label="Males")
p
Two questions remaining. Firstly have I used a large amount of code to acheive this or is this about right for the effect that I'm after?