Hi Jack, Is this what you want?
barplot(table( female_familar$gender, female_familar$familar),beside=TRUE,col=c(4,5), ylim=c(0,20),xlab="Familiarity", ylab="Participants in the survey") legend("topleft",c('Females','Males'),col=c(4,5),pch=15) or barplot(table( female_familar$gender, female_familar$familar),col=c(4,5),xlab="Familiarity", ylab="Participants in the survey") legend("topleft",c('Females','Males'),col=c(4,5),pch=15) HTH, Jorge On Thu, May 8, 2008 at 6:41 AM, hoogeebear <[EMAIL PROTECTED]> wrote: > > Hi, > > I created some bar charts. My first one is concerned with males, and my > second concerned with females. > Is there a way I can put the charts into one chart? There is 2 different > columns in each file. Here is my new file containing males and females: > > gender,familar > Female,Yes > Female,Yes > Female,Yes > Female,Yes > Female,Yes > Female,No > Female,Yes > Female,Yes > Female,Yes > Female,Yes > Female,Yes > Female,Yes > Female,No > Female,Yes > Female,No > Female,Yes > Female,Yes > Female,Yes > Female,Yes > Female,Yes > Male,Yes > Male,Yes > Male,Yes > Male,No > Male,No > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,Yes > Male,No > Male,Yes > Male,Yes > > Here is the code I use for creating a female chart: > library(plotrix) > library(prettyR) > female_familar <-read.table("C://females.csv", sep=",", header=TRUE) > > barp(rbind(rep(length(female_familar$gender),2),freq(female_familar$familar)[[1]]), > ylab="20 Females participated in the survey", > col=4:5,names.arg=c("Females No(3)","Females Yes(17)")) > legend("topright",c("Females","Familarity"),fill=4:5) > > Does the above need to change much to include males and females in the one > bar chart? > > Hope to hear from someone soon. > > Regards, > > Jack. > -- > View this message in context: > http://www.nabble.com/Bar-Charts-tp17124678p17124678.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. > [[alternative HTML version deleted]] ______________________________________________ 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.