From: Duncan Murdoch (murdoch@stats.uwo.ca)
Date: Thu 21 Jun 2001 - 01:16:03 EST
Message-ID: <j3f1jt8p98cgdsa4oj35f9rlim4eh0k5vl@4ax.com>
I don't know why one version works and the other doesn't, but I've
noticed problems in the past when using "data" as a variable name, and
in fact even the first version fails for me when I type it exactly as
you did.
I suspect the strange behaviour you saw is related to the fact that
data is a matrix rather than a data.frame, and indeed everything is
fine if I change your code to
x<-dataframe[,1]*149
y<-dataframe[,2]*149
z<-dataframe[,3]
d<-data.frame(x,y,z) # use data.frame, not cbind
# Fit plane to surface
result<-lm(z~x+y,d)
Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This archive was generated by hypermail 2b30 : Fri 22 Jun 2001 - 18:58:45 EST