[R] error in eval

philthe1st philip.brown at bristol.ac.uk
Tue Nov 26 12:43:58 CET 2013


Hi there, I am learning to use and understand R but have come up against a
problem. I'm sure it is a pretty simple thing, but I can't find a solution.
I wonder if anyone could help?

I have been using the "The R Book" by Crawley and working through some of
the examples before trying to apply them to my data.

Yesterday I tried to following from page 560:

> lizards<-read.table('lizards.txt',header=T,sep='\t')
> head(lizards)
   n   sun height  perch    time  species
1 20 Shade   High  Broad Morning opalinus
2 13 Shade    Low  Broad Morning opalinus
3  8 Shade   High Narrow Morning opalinus
4  6 Shade    Low Narrow Morning opalinus
5 34   Sun   High  Broad Morning opalinus
6 31   Sun    Low  Broad Morning opalinus
> model1<-glm(n~sun*height*perch*time*species,poisson)

The GLM worked and I got the correct results.

In the mean time I have had a play around with my data in R and installed
package "pscl". I then then came to back to page 560 to play around with
some variables and could not load the glm I needed. This time, using the
exact same codes as above I received the message:

Error in eval(expr, envir, enclos) : object 'n' not found

Looking at other peoples questions about this problem I have tried changing
"sep" but with no luck. Can anyone help  me work out what has changed since
yesterday and how to get the glm codes working again?

Thank you in advance for any help/suggestions.
Phil



--
View this message in context: http://r.789695.n4.nabble.com/error-in-eval-tp4681170.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list