Hi, Im having trouble creating the following graph. Here is my code:
library(plotrix) library(prettyR) female_improvement <-read.table("C://project/graphs/gender/breakdown/gender-improvement/female-improvement.csv", sep=",", header=TRUE) barp(rbind(rep(length(female_improvement$gender),2),freq(female_improvement$reason)[[1]]), ylab="22 Males participated in the survey", col=4:5,names.arg=c(" Females Info entered is relevant(4)"," Males Room for Improvement(18)")) legend("topright",c("Females","Reason"),fill=4:5) Here is the error: Error in axis(1, at = 1:ngroups, labels = names.arg, cex.axis = cex.axis) : 'at' and 'labels' lengths differ, 3 != 2 In addition: Warning messages: 1: package 'prettyR' was built under R version 2.7.0 2: In rbind(rep(length(female_improvement$gender), 2), freq(female_improvement$reason)[[1]]) : number of columns of result is not a multiple of vector length (arg 1) Here is the file: gender,reason Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Info entered is all relevant Female,Room for Improvement Female,Room for Improvement Female,Room for improvement Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Info entered is all relevant Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement Female,Room for Improvement I use the exact same code when creating the same chart for male and it works fine.(change female variable to male) Any suggestions as to how to resolve the problem? Thanks in advance. Hope to hear from someone soon. Jack. -- View this message in context: http://www.nabble.com/Cant-resolve-Error-Message-tp17016312p17016312.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.