[R] Bug in "example"

Michael Meyer michael.m.meyer at boeing.com
Tue Mar 9 19:42:35 CET 1999


On my system
> version
           _                   
platform   sparc-sun-solaris2.5
arch       sparc               
os         solaris2.5          
system     sparc, solaris2.5   
status                         
status.rev 0                   
major      0                   
minor      63.3                
year       1999                
month      March               
day        6                   
language   R            

the example() function seems to have a bug.  Specifically commands such 
as
	example(layout)
fail, even though there is a layout example.   The problem seems to be 
that the example function tries to open (in this case) layout.show.R 
instead of layout.R.

I think this is because the example function is looking at the first 
column of the AnIndex file instead of the second column.  If one 
changes,
        file <- system.file(paste("R-ex", directory.sep, 
                                  AnIndex[2 * i], ".R", sep = ""), pkg = pkg, 

to

        file <- system.file(paste("R-ex", directory.sep, 
                                  AnIndex[2 * i+1], ".R", sep = ""), pkg = pkg, 

it seems to work for me. (Note the fix has [2 * i + 1])

Mike Meyer, Applied Statistics, The Boeing Company

(and yes, I am the same person who used to be at Carnegie Mellon)



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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