On Jun 12, 9:07 am, kcrisman <kcris...@gmail.com> wrote:
> > 1) Get a list of recommended packages from that version of R -
> > preferably in a way that does not require them to be hard-coded in a
> > test script, but generated by R.
>
> Unfortunately, I couldn't find one when I was looking for it. It might
> be worth asking the R list whether there is something like this that
> does not require Internet (which, after all, should not be a
> requirement for building Sage once one actually has a Sage copy), nor
> parsing some huge list of *all* packages.

The shell script could parse the directory where the Recommended
packages live by calling (from the root of the R directory)

ls src/library/Recommended/*.tar.gz

src/library/Recommended/boot_1.2-42.tar.gz        src/library/
Recommended/Matrix_0.999375-38.tar.gz
src/library/Recommended/class_7.3-2.tar.gz        src/library/
Recommended/mgcv_1.6-2.tar.gz
src/library/Recommended/cluster_1.12.3.tar.gz     src/library/
Recommended/nlme_3.1-96.tar.gz
src/library/Recommended/codetools_0.2-2.tar.gz    src/library/
Recommended/nnet_7.3-1.tar.gz
src/library/Recommended/foreign_0.8-40.tar.gz     src/library/
Recommended/rpart_3.1-46.tar.gz
src/library/Recommended/KernSmooth_2.23-3.tar.gz  src/library/
Recommended/spatial_7.3-2.tar.gz
src/library/Recommended/lattice_0.18-5.tar.gz     src/library/
Recommended/survival_2.35-8.tar.gz
src/library/Recommended/MASS_7.3-5.tar.gz


> Ben's way of testing them should work 
> (seehttp://cran.r-project.org/doc/manuals/R-admin.html,
> and he is right that library('tools') is needed), but I don't know how
> to get a shell script like spkg-check to run these commands in R, or
> anything else.   Of course, this would do a lot more than check their
> presence, and would be more or less like running spkg-check, I guess.

If the commands can be put into a .R file, then spkg-check can just
run that file, e.g.

R --no-save < myFile.R > myOutput.txt

If something dynamic needs to be done then something like

echo "thisFunctionDoesNotExist(); norThisOne()" | R --no-save

would work, and by work I mean fail in this case.

There are some other ways too.

Ben

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to