Hi there: 
I have a sample data set that looks like below.  The variable 'value' 
represents the counts of cases in each response category.  And I would like to 
get the barchart to graph the number of responses as a percentage of each total 
*subpopulation* (Males compared to Females), rather than as a percentage of 
*all* the responses.
Can someone provide a suggestion?
Thank you

Yours, Simon Kiss
#Sample Code
sample.dat<-data.frame(response.category=rep(c('A', 'B','C'), 2), 
value=c(50,25,25, 25,25,25), pop=c(rep('Males', 3), rep('Females', 3)))
#Draw GGPLot
test<-ggplot(sample.dat, aes(x=response.category,y=value, group=pop))
test+geom_bar(stat='identity', position='dodge',aes(fill=pop))

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to