Full_Name: richard wright Version: R version 2.6.1 (2007-11-26) OS: Mac OS X v 10.4.11 Submission from: (NULL) (76.240.79.123) I downloaded the most recent version of R for the mac (About: GUI 1.22-devel (4859) (4859)) and installed it. After installation, I opened the help file and ran the demo. I am new to R, although I have over 25 years experience in SAS. Below is a part of the job I ran. I think I ran the code correctly, but I seem to be blowing off. And, I'm not sure it's related, but I also included what I got when I ran bug.report()> dummy <- data.frame(x=x, y =x+rnorm(x)*w) > dummyx y 1 1 1.425904 2 2 -1.083024 3 3 -1.976215 4 4 4.185795 5 5 8.598591 6 6 1.004177 7 7 5.357826 8 8 9.033184 9 9 6.455373 10 10 8.166066 11 11 12.383454 12 12 10.823910 13 13 14.410394 14 14 13.046184 15 15 15.912303 16 16 13.454527 17 17 15.827133 18 18 18.586979 19 19 10.845216 20 20 20.935347> fm <-lm(y-x,data=dummy)Error in switch(mode(x), "NULL" = structure(NULL, class = "formula"), : invalid formula In addition: Warning message: In y - x : longer object length is not a multiple of shorter object length> ls()[1] "dummy" "w" "x" "y"> bug.report()Error in bug.report() : 'subject' missing>
> Date: Mon, 24 Dec 2007 07:00:23 +0100 (CET)> From: rcwright at texas.net Subject: [Rd] Errors in demo (PR#10527) > To: r-devel at stat.math.ethz.ch > R version 2.6.1 (2007-11-26) OS: Mac OS X v 10.4.11 > Submission from: (NULL) (76.240.79.123) > I downloaded the most recent version of R for the mac (About: GUI > 1.22-devel (4859) (4859)) and installed it. After installation, I > opened the help file and ran the demo. I am new to R, although I have > over 25 years experience in SAS. Below is a part of the job I ran. I > think I ran the code correctly, but I seem to be blowing off. And, I'm > not sure it's related, but I also included what I got when I ran > bug.report() > > dummy <- data.frame(x=x, y =x+rnorm(x)*w) > > dummy x y 1 1 1.425904 2 2 -1.083024 3 3 -1.976215 4 4 4.185795 5 5 8.598591 6 6 1.004177 7 7 5.357826 8 8 9.033184 9 9 6.455373 10 10 8.166066 11 11 12.383454 12 12 10.823910 13 13 14.410394 14 14 13.046184 15 15 15.912303 16 16 13.454527 17 17 15.827133 18 18 18.586979 19 19 10.845216 20 20 20.935347 > > fm <-lm(y-x,data=dummy) > Error in switch(mode(x), "NULL" = structure(NULL, class = "formula"), : invalid formula > In addition: Warning message: > In y - x : longer object length is not a multiple of shorter object length > > ls() [1] "dummy" "w" "x" "y" > > bug.report() Error in bug.report() : 'subject' missing Hi, The formula should be fm <-lm(y~x,data=dummy) instead of the minus sign What help file are you referring to? Iago
> Date: Mon, 24 Dec 2007 07:00:23 +0100 (CET)> From: rcwright at texas.net Subject: [Rd] Errors in demo (PR#10527) > To: r-devel at stat.math.ethz.ch > R version 2.6.1 (2007-11-26) OS: Mac OS X v 10.4.11 > Submission from: (NULL) (76.240.79.123) > I downloaded the most recent version of R for the mac (About: GUI > 1.22-devel (4859) (4859)) and installed it. After installation, I > opened the help file and ran the demo. I am new to R, although I have > over 25 years experience in SAS. Below is a part of the job I ran. I > think I ran the code correctly, but I seem to be blowing off. And, I'm > not sure it's related, but I also included what I got when I ran > bug.report() > > dummy <- data.frame(x=x, y =x+rnorm(x)*w) > > dummy x y 1 1 1.425904 2 2 -1.083024 3 3 -1.976215 4 4 4.185795 5 5 8.598591 6 6 1.004177 7 7 5.357826 8 8 9.033184 9 9 6.455373 10 10 8.166066 11 11 12.383454 12 12 10.823910 13 13 14.410394 14 14 13.046184 15 15 15.912303 16 16 13.454527 17 17 15.827133 18 18 18.586979 19 19 10.845216 20 20 20.935347 > > fm <-lm(y-x,data=dummy) > Error in switch(mode(x), "NULL" = structure(NULL, class = "formula"), : invalid formula > In addition: Warning message: > In y - x : longer object length is not a multiple of shorter object length > > ls() [1] "dummy" "w" "x" "y" > > bug.report() Error in bug.report() : 'subject' missing Hi, The formula should be fm <-lm(y~x,data=dummy) instead of the minus sign What help file are you referring to? The example in R-intro you might be talking about reads, as expected, fm <- lm(y ~ x, data=dummy) Iago
On 24/12/2007 1:00 AM, rcwright at texas.net wrote:> Full_Name: richard wright > Version: R version 2.6.1 (2007-11-26) > OS: Mac OS X v 10.4.11 > Submission from: (NULL) (76.240.79.123) > > > I downloaded the most recent version of R for the mac (About: GUI 1.22-devel > (4859) (4859)) and installed it. > After installation, I opened the help file and ran the demo. I am new to R, > although I have over 25 years experience in SAS. > > Below is a part of the job I ran. I think I ran the code correctly, but I seem > to be blowing off. > And, I'm not sure it's related, but I also included what I got when I ran > bug.report() > >> dummy <- data.frame(x=x, y =x+rnorm(x)*w) >> dummy > x y > 1 1 1.425904 > 2 2 -1.083024 > 3 3 -1.976215 > 4 4 4.185795 > 5 5 8.598591 > 6 6 1.004177 > 7 7 5.357826 > 8 8 9.033184 > 9 9 6.455373 > 10 10 8.166066 > 11 11 12.383454 > 12 12 10.823910 > 13 13 14.410394 > 14 14 13.046184 > 15 15 15.912303 > 16 16 13.454527 > 17 17 15.827133 > 18 18 18.586979 > 19 19 10.845216 > 20 20 20.935347 >> fm <-lm(y-x,data=dummy) > Error in switch(mode(x), "NULL" = structure(NULL, class = "formula"), : > invalid formulaThis looks like your error, rather than a bug in R. The formula should be "y ~ x" (y tilde x), not "y - x".> In addition: Warning message: > In y - x : longer object length is not a multiple of shorter object lengthThis warning is also a consequence of the typo, in a roundabout way. It is saying that x and y are different lengths, which is clearly not true for the columns of dummy: but because you just subtracted them, it took x and y to be variables in their own right, not columns. Presumably the objects listed below are different lengths.>> ls() > [1] "dummy" "w" "x" "y" >> bug.report() > Error in bug.report() : 'subject' missingPlease check on R-help or R-devel first, until you're sure something is a bug. It takes a bit of effort to deal with a bug report regardless of whether it is real or not. Duncan Murdoch
I have no idea what 'demo' this is. When I open R it says Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. and this is none of those. At a guess you meant x <- 1:20 w <- 1 + sqrt(x)/2 dummy <- data.frame(x=x, y= x + rnorm(x)*w) dummy fm <- lm(y ~ x, data=dummy) from the 'sample session' in 'An Introduction to R'. In which case, this is your own typing error (- for ~, and we do put spaces in to make it easier to read). Please do read the R FAQ *before* 'blowing off' a false report. On Mon, 24 Dec 2007, rcwright at texas.net wrote:> Full_Name: richard wright > Version: R version 2.6.1 (2007-11-26) > OS: Mac OS X v 10.4.11 > Submission from: (NULL) (76.240.79.123) > > > I downloaded the most recent version of R for the mac (About: GUI 1.22-devel > (4859) (4859)) and installed it. > After installation, I opened the help file and ran the demo. I am new to R, > although I have over 25 years experience in SAS. > > Below is a part of the job I ran. I think I ran the code correctly, but I seem > to be blowing off. > And, I'm not sure it's related, but I also included what I got when I ran > bug.report() > >> dummy <- data.frame(x=x, y =x+rnorm(x)*w) >> dummy > x y > 1 1 1.425904 > 2 2 -1.083024 > 3 3 -1.976215 > 4 4 4.185795 > 5 5 8.598591 > 6 6 1.004177 > 7 7 5.357826 > 8 8 9.033184 > 9 9 6.455373 > 10 10 8.166066 > 11 11 12.383454 > 12 12 10.823910 > 13 13 14.410394 > 14 14 13.046184 > 15 15 15.912303 > 16 16 13.454527 > 17 17 15.827133 > 18 18 18.586979 > 19 19 10.845216 > 20 20 20.935347 >> fm <-lm(y-x,data=dummy) > Error in switch(mode(x), "NULL" = structure(NULL, class = "formula"), : > invalid formula > In addition: Warning message: > In y - x : longer object length is not a multiple of shorter object length >> ls() > [1] "dummy" "w" "x" "y" >> bug.report() > Error in bug.report() : 'subject' missing >> > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595