Skip to content

error in eval

4 messages · philthe1st, Peter Dalgaard, David L Carlson

#
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:
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
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.
#
AFAICT, your code should not be expected to run unless you have an attach(lizards) prior to the glm() call. Either that or you need data=lizards in the call itself.

-pd
On 26 Nov 2013, at 12:43 , philthe1st <philip.brown at bristol.ac.uk> wrote:

            

  
    
#
And in fact

attach(lizards)

is included on page 560. You must have left it out of your
example code. Without it, your first example would not have run
either. 

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org] On Behalf Of peter
dalgaard
Sent: Tuesday, November 26, 2013 8:01 AM
To: philthe1st
Cc: r-help help
Subject: Re: [R] error in eval

AFAICT, your code should not be expected to run unless you have
an attach(lizards) prior to the glm() call. Either that or you
need data=lizards in the call itself.

-pd

On 26 Nov 2013, at 12:43 , philthe1st
<philip.brown at bristol.ac.uk> wrote:

            
up against a
find a solution.
through some of
and installed
around with
using the
tried changing
changed since
http://r.789695.n4.nabble.com/error-in-eval-tp4681170.html
http://www.R-project.org/posting-guide.html
code.