Skip to content
Prev 294889 / 398502 Next

step function stops with "subscript out of bounds"

Thanks.  

I guess I still don't understand what's going on. It's not at all intuitive
that the table used should be in the search path. Why is it searching for
the table? Isn't the table already stored in the model? If the documentation
says this, I haven't found it. Needing to know what names I can't use is a
bit disconcerting. I can think of names with high probability of uniqueness
but how could I ever be sure?

Table "X" is built on the fly in a script. What I supplied here was a
portion of the remaining script. I suppose the solution is to store it in an
environment in the search path. 

DAV
	

-----Original Message-----
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
Sent: Thursday, May 17, 2012 6:46 AM
To: David A Vavra
Cc: r-help at r-project.org
Subject: Re: [R] step function stops with "subscript out of bounds"
On 17/05/2012 09:25, David A Vavra wrote:
I've
The
runs
A lack of understanding of 'non-standard evaluation'.  X (or at least, 
the X you want) is not visible from the standard search path.
Which will tell you
Error in eval(expr, envir, enclos) : could not find function "loglm"

If you correct that and use a vanilla session you will get

Error in loglm(formula = ~Class + Sex + Age + Survived + Class:Sex + 
Class:Age +  :
   object 'X' not found

which is more informative.

So the solution is to

- use less easily masked names than 'X'.
- ensure the data object is visible on the search path.
k,
http://www.R-project.org/posting-guide.html