I've recently installed R-1.4.0 and I'm having the devil's own
time trying to install a home-made package. As far as I can tell,
I'm doing the same things that I did previously, under 1.3.1, but
somehow everything goes haywire. (Quite possibly I'm simply
mis-remembering what I did before, but I can't for the life of me
figure out what to change).
A toy example of what I did is as follows:
- create a directory ``Junk'' in ~rolf/Rlib
- inside Junk create files DESCRIPTION and INDEX
- inside Junk create a directory R containing function
code files foo.R and bar.R
- inside Junk create a directory man containing documentation
files foo.Rd bar.Rd
- in the directory Rlib issue the command
R CMD INSTALL -l . Junk
I get the following response:
Installing *source* package `Junk' ...
R
cat: cannot open R/bar.R
cat: cannot open R/foo.R
cp: INDEX and /home1/faculty/rolf/Rlib/Junk/INDEX are identical
cat: write error: Bad address
help
cat: cannot open man/bar.Rd
cat: cannot open man/foo.Rd
>>> Building/Updating help pages for package `Junk'
Formats: text html latex example
Junk text html latex
DONE (Junk)
DONE (INSTALL)
Then inside Junk/R is the ***empty*** file ``Junk'' (and the
files foo.R and bar.R have been removed); likewise inside Junk/man
is the ***empty*** file ``Junk.Rd'' (and the files foo.Rd and bar.Rd
have been removed).
The fact that the original files were removed without trace is very
disturbing --- could be (was, actually) a lot of work to replace them
in a real example.
Why on earth can't it open those files?
What am I doing wrong?
Version details:
> version
_
platform sparc-sun-solaris2.7
arch sparc
os solaris2.7
system sparc, solaris2.7
status
major 1
minor 4.0
year 2001
month 12
day 19
language R
cheers,
Rolf Turner
rolf at math.unb.ca
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You shouldn't be installing into `.' You install packages into a *library* and the default (R_HOME/library if R_LIBS is unset) is normally sufficient. Yes, if you install onto the sources it will now wipe out what it thinks of as older and unnecessary files, and that is new in 1.4.0. On Wed, 2 Jan 2002, Rolf Turner wrote:> > I've recently installed R-1.4.0 and I'm having the devil's own > time trying to install a home-made package. As far as I can tell, > I'm doing the same things that I did previously, under 1.3.1, but > somehow everything goes haywire. (Quite possibly I'm simply > mis-remembering what I did before, but I can't for the life of me > figure out what to change). > > A toy example of what I did is as follows: > > - create a directory ``Junk'' in ~rolf/Rlib > > - inside Junk create files DESCRIPTION and INDEX > > - inside Junk create a directory R containing function > code files foo.R and bar.R > > - inside Junk create a directory man containing documentation > files foo.Rd bar.Rd > > - in the directory Rlib issue the command > > R CMD INSTALL -l . Junk > > I get the following response: > > Installing *source* package `Junk' ... > R > cat: cannot open R/bar.R > cat: cannot open R/foo.R > cp: INDEX and /home1/faculty/rolf/Rlib/Junk/INDEX are identical > cat: write error: Bad address > help > cat: cannot open man/bar.Rd > cat: cannot open man/foo.Rd > >>> Building/Updating help pages for package `Junk' > Formats: text html latex example > Junk text html latex > DONE (Junk) > > DONE (INSTALL) > > Then inside Junk/R is the ***empty*** file ``Junk'' (and the > files foo.R and bar.R have been removed); likewise inside Junk/man > is the ***empty*** file ``Junk.Rd'' (and the files foo.Rd and bar.Rd > have been removed). > > The fact that the original files were removed without trace is very > disturbing --- could be (was, actually) a lot of work to replace them > in a real example. > > Why on earth can't it open those files? > > What am I doing wrong? > > Version details: > > > version > _ > platform sparc-sun-solaris2.7 > arch sparc > os solaris2.7 > system sparc, solaris2.7 > status > major 1 > minor 4.0 > year 2001 > month 12 > day 19 > language R > > cheers, > > Rolf Turner > rolf at math.unb.ca > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at 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-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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Brian: Thanks for your response to my posting to the r-help list. You wrote:> You shouldn't be installing into `.' You install packages into a > *library*(a) Installing into `.' seemed to work fine under 1.3.1. (b) What then, is a ``library''? I took ``library'' to mean a directory containing a number of subdirectories, each of which constituted a package. So when I am located in ~rolf/Rlib --- which is what I want to be my ``personal library'' --- and I install into `.' then I ***am*** installing into a library, since `.' ***is*** a library. If the foregoing does not make sense, then I am clearly misunderstanding the nature of the library/packages structure. And if this is indeed the case, then I think the documentation should be clarified. The documentation currently says A package consists of a subdirectory containing the files DESCRIPTION and INDEX, and the subdirectories R, data, demo, exec, inst, man, src, and tests (some of which can be missing). and To install into the library tree `lib', use `R CMD INSTALL -l lib pkgs'. Both `lib' and the elements of `pkgs' may be absolute or relative path names. There appears to me to no special requirements for the directory `lib' and in particular nothing saying that `lib' cannot be the current working directory.> and the default (R_HOME/library if R_LIBS is unset) is normally > sufficient.I am working on a multi-user system, not on a PC. I am not working as root, and I am trying to install a package in a ***personal*** library, NOT in a generally available ``system'' library.> Yes, if you install onto the sources it will now wipe out what it > thinks of as older and unnecessary files, and that is new in > 1.4.0.That seems to me to be at the very least a dangerous design flaw. To destroy code without warning and without saving a back-up --- even if the user is doing something stupid (and given that what I was doing used to work in version 1.3.1 I don't think it was all ***that*** stupid) --- is asking for trouble. I had to re-write a good bit of code and documentation because of this behaviour. cheers, Rolf -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Brian: Thanks for your further explanation about packages in R. You wrote> They [i.e. packages installed into a library ] constitute binary > not source packages.The distinction between the two concepts appears not to be made anywhere in the documentation as far as I can see. At least it is not made prominently. Furthermore the distinction is unique to R --- i.e. it does not exist in S[plus] (see below), which is where I'm coming from.> > There appears to me to no special requirements for the > > directory `lib' and in particular nothing saying that `lib' > > cannot be the current working directory. >> Well, of course it can, but it should not contain existing source > packages of the same name! That's just adding confusion. It doesn't > say so, because I suspect no one considered doing something *that* > confusing.Why is it confusing? Unless the distinction between the two concepts of ``source'' and ``binary'' packages has been made --- and perhaps the reason for having the two distinct concepts elucidated! --- how could the ordinary mortal anticipate that a distinction has to be made? No such distinction exists in Splus. In Splus you simply build a ``chapter''; there is no ``source'' chapter and ``binary'' chapter. And no confusion. O.K. R is different here; no problem with that. But the difference should be emphasized to the unwary --- especially when there is the risk a large amount of code and documentation being destroyed without warning. cheers, Rolf -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._