[Rd] system.file("",package) (PR#1062)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Mon, 20 Aug 2001 08:44:02 +0200 (MET DST)

On Mon, 20 Aug 2001 tlumley@u.washington.edu wrote:

> system.file("",package") is documented to return the root of the package
> (as it did in the past). It actually returns "" (Win98, R1.3.0), breaking
> the SJava package

My Unix systems give results like

> system.file("", package="eda")
[1] "/ext/R/1.3.0/lib/R/library/eda/"
> system.file("",package="Rstreams")
[1] "/ext/R/library/Rstreams/"

under 1.3.0.  It's the trailing slash that is the problem, and which is not
as documented in the Value section. That is not a file under Windows, and
so file.exists() fails.  (That suprised me a bit, but one could argue it is
not actually a file under Unix either: the directory file is
/ext/R/1.3.0/lib/R/library/eda and that does work.)

Rather than special-case system.file("",package), I think we should remove
the `or \code{""}' from the documentation.

(The problem with SJava on Windows is one of several I reported to DTL on
Mon Jul 16.)

Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-devel 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-devel-request@stat.math.ethz.ch