I am trying to add a regression line to this facet_grid, but i seem to be having problems.
qplot(date, data=ua, geom="bar",
weight=count,
ylab="New User Count",
xlab='Date',
main='New Users by Type Last 3 Months',
colour=I('lightgreen'),
fill=I('grey')) +
facet_grid(un_region~role, scales='free', space='free_y') +
opts(axis.text.x =theme_text(angle=45, size=5))
Here's a sample of the data i am working with, note that the counts need to be summed, this is why i am using weight=count, not sure if there is a better way.
date role name un_region un_subregion us_state count
1 2012-06-21 ENTREPRENEUR Australia Oceania Australia and New Zealand 2
2 2012-06-21 ENTREPRENEUR Belgium Europe Western Europe 1
Thanks.