[R] Error using lm(z~x+y,data)

tomsv193@student.liu.se tomsv193 at student.liu.se
Wed Jun 20 15:26:15 CEST 2001


Hi!

I am fitting a plane to a surface:

This works excellent:
---------------------------------
x<-dataframe[,1]
y<-dataframe[,2]
z<-dataframe[,3]
data<-cbind(x,y,z)

# Fit plane to surface
result<-lm(z~x+y,data)
---------------------------------

But I need to rescale the x,y parameters. So:
-----------------------------
x<-dataframe[,1]*149
y<-dataframe[,2]*149
z<-dataframe[,3]
data<-cbind(x,y,z)

# Fit plane to surface
result<-lm(z~x+y,data)
----------------------------------

And surprisingly this does not work. Error message is:

Error in eval(attr(formula, "variables"), data, env) : 
        sys.frame: not that many enclosing functions

Why does this happen?


kind regards
Tomas Svensson
EVOTEC,Hamburg


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list