R-alpha: libraries

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Thu, 11 Dec 1997 09:43:55 +0100

>>>>> Paul Gilbert writes:

> I have been trying to set up my time series library with the new
> library mechanism. It is a fairly large amount of code and previously
> I split it into five pieces in order to load it into R. (Has anything
> changed which might suggest I shouldn't need to do this anymore?)  The
> five files are called dse1, dse2, dsex1, dsex2, and tframe.With the
> new way of handling libraries I put these in
> /home/res/gilp/dse/pub/Rdse/R and ran

> [58] /home/res/gilp/dse/pub : R INSTALL Rdse dse1
> Installing package `Rdse' ...
> R
> No man pages found in package `Rdse'

> (BTW this prepend $pwd to Rdse and does not seem to like a fully
> qualified path for the location, so it has to be done in the directory
> above Rdse)

> Indications seem to be that this worked (except for the man pages), but when I
> set RLIBS and run R the library is not found:
>> library()
> Packages in library `/home/res/gilp/dse/pub/Rdse':

> Packages in library `/home/res8/gilp/R-versions/R-0.60.1/R-0.60.1/library':
> ...

> However, if I call one of the files Rdse and do
> R INSTALL Rdse Rdse

> then things seem to work correctly in that it finds that file. Does
> this mean that the file with the code must have the same name as the
> package name, which must be the same as the directory name?
> (i.e. .../pkg/R/pkg) Does this mean that I have to create separate
> library directories for each of the pieces?

There is a bug in the R 0.60 INSTALL mechanism that will be fixed in the
next release.

What you are talking about is splitting a PACKAGE into separate MODULES
(Core Team, correct me if I am wrong, was this the term we agreed on?).
This would result in an extension of the current INSTALL and library()
scenario that I would very much appreciate.

Re loading, my idea was to have

	library(MODULE, pkg = PACKAGE, lib = LIBRARY)

or something similar which would allow you to load the module from the
package in the library.  Of course, the inferface is open for

Re installing, this is not do easy.  One could have a Makefile in the
`R' subdir indicating how to combine the various .R files into modules,
but I am not quite sure how to do this right.

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