Re: [R] Cant resolve Error Message

From: jim holtman <jholtman_at_gmail.com>
Date: Fri, 02 May 2008 08:28:16 -0400

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?

______________________________________________
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.
Received on Fri 02 May 2008 - 12:40:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 02 May 2008 - 13:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive