[R] Cant resolve Error Message
jim holtman
jholtman at gmail.com
Fri May 2 14:28:16 CEST 2008
It appears that you have a problem in your data. Here is just the
rbind in the call:
> rbind(rep(length(female_improvement$gender),2),freq(female_improvement$reason)[[1]])
Info entered is all relevant Room for improvement Room for Improvement
[1,] 20 20 20
[2,] 2 1 17
Warning message:
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)
>
It is the one producing the error message. Is this normal?
On Fri, May 2, 2008 at 7:48 AM, hoogeebear <jack200519 at yahoo.ie> wrote:
>
> 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 at 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.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help
mailing list