[R] Error in eval(expr, envir, enclos) : object 'x' not found

Peter Dalgaard pdalgd at gmail.com
Sat Oct 16 09:40:34 CEST 2010


On 10/16/2010 09:27 AM, Jumlong Vongprasert wrote:
>> predict(lm(x~y),IWJR.complete)
> Error in eval(expr, envir, enclos) : object 'x' not found
>> >
> I'm trying to find answers to solve my problem, but I cann't found  what I
> want to solve the problem.
> What do I have to do to solve this problem.

First isolate it. Break things down into steps by rewriting as

fit <- lm(x~y)
predict(fit, IWJR.complete)

I think you will find that it fails already in the first step, because
you didn't tell lm where to look for its variables (it's not going to
try guessing it from context, and besides it might not be intended to
use the same data as used for prediction).

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list