Re: [R] Error in variable ' _' converted to a factor AND *tmp*

2012-01-18 Thread Jhope
Thank you, I am new to R, and this forum. Aevent does not exist. I will also
try to post a better subject next time. 

--
View this message in context: 
http://r.789695.n4.nabble.com/Error-in-variable-converted-to-a-factor-AND-tmp-tp4305951p4308803.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.


Re: [R] Error in variable ' _' converted to a factor AND *tmp*

2012-01-18 Thread Milan Bouchet-Valat
Le mardi 17 janvier 2012 à 23:56 -0800, Jhope a écrit :
> I am wondering if anyone can tell me what the error I'm receiving means
> below. I thought it said that Aeventexhumed should be converted to a factor,
> so I tried to do so and received the following error. 
> 
> Please advise. J
> -
> 
> > data.to.analyze.glm <- glm(cbind(MaxHatch, TotalEggs-MaxHatch) ~
> > Aeventexhumed, family=binomial, data=data.to.analyze)
> Warning message:
> In model.matrix.default(mt, mf, contrasts) :
>   variable 'Aeventexhumed' converted to a factor
> 
> > data.to.analyze$Aevent ~ as.factor(data.to.analyze$Aevent)
> data.to.analyze$Aevent ~ as.factor(data.to.analyze$Aevent)
What is this supposed to do? You're just creating a formula and printing
it here.

> > data.to.analyze$Aeventexhumed <- as.factor(data.to.analyze$Aevent)
> Error in `$<-.data.frame`(`*tmp*`, "Aeventexhumed", value = integer(0)) : 
>   replacement has 0 rows, data has 127
This simply means that data.to.analyze$Aeventexhumed is of length 127,
while data.to.analyze$Aevent is of length 0 (or most probably doesn't
exist).

I think you meant to do:
data.to.analyze$Aeventexhumed <- factor(data.to.analyze$Aeventexhumed)


Regards

__
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.


[R] Error in variable ' _' converted to a factor AND *tmp*

2012-01-18 Thread Jhope
 I am wondering if anyone can tell me what the error I'm receiving means
below. I thought it said that Aeventexhumed should be converted to a factor,
so I tried to do so and received the following error. 

Please advise. J
-

> data.to.analyze.glm <- glm(cbind(MaxHatch, TotalEggs-MaxHatch) ~
> Aeventexhumed, family=binomial, data=data.to.analyze)
Warning message:
In model.matrix.default(mt, mf, contrasts) :
  variable 'Aeventexhumed' converted to a factor

> data.to.analyze$Aevent ~ as.factor(data.to.analyze$Aevent)
data.to.analyze$Aevent ~ as.factor(data.to.analyze$Aevent)

> data.to.analyze$Aeventexhumed <- as.factor(data.to.analyze$Aevent)
Error in `$<-.data.frame`(`*tmp*`, "Aeventexhumed", value = integer(0)) : 
  replacement has 0 rows, data has 127

> summary(data.to.analyze$Aeventexhumed)
   Length Class  Mode 
  127 character character 

--
View this message in context: 
http://r.789695.n4.nabble.com/Error-in-variable-converted-to-a-factor-AND-tmp-tp4305951p4305951.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.