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

Prof Brian D Ripley ripley@stats.ox.ac.uk
Mon, 20 Aug 2001 07:43:41 +0100 (BST)


On Mon, 20 Aug 2001, Kurt Hornik wrote:

> >>>>> tlumley  writes:
>
> > 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
>
> > Omitting the first argument does work correctly and so is a workaround
> > if the argument is explicitly "" but not if it is the value of a
> > variable.
>
> Thomas,
>
> I think you are misreading the docs: we have
>
>      system.file(..., package = "base", lib.loc = .lib.loc, pkg, lib)
>
> so the package argument must be named.
>
> I think you were caught by
>
> 	R> system.file("", "eda")
> 	[1] ""
>
> but you need to do
>
> 	R> system.file("", package = "eda")
> 	[1] "/usr/local/lib/R/library/eda/"

Sorry, that's using a Unix-specific interpretation of file.exists,
so does not work under Windows.

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