[Rd] Errors in demo (PR#10527)

Iago Mosqueira iago.mosqueira at gmail.com
Mon Dec 24 12:16:22 CET 2007


 > 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



More information about the R-devel mailing list