Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 96600

Summary: install add-on packages for dev-lang/R using package managers
Product: Gentoo Linux Reporter: Gábor BORGULYA <bugzilla>
Component: Current packagesAssignee: Gentoo Science Mathematics related packages <sci-mathematics>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: auke, vanquirius
Priority: High Keywords: SOCIDEAS
Version: unspecified   
Hardware: x86   
OS: Linux   
URL: http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Add_002dOn-Packages
Whiteboard:
Package list:
Runtime testing required: ---

Description Gábor BORGULYA 2005-06-20 05:02:00 UTC
dev-lang/R can be installed using the portage system, which is wonderful. 
However, many add-on packages were developed for R which can be installed 
now only without portage. 
I would be very happy to see the add-on packages in the portage system. 
 
The current way of installing R packages is described in the R FAQ: 
http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Add_002dOn-Packages 

Reproducible: Always
Steps to Reproduce:
Comment 1 Anthony Staines 2005-08-03 16:02:58 UTC
This would be a valuable addition to Gentoo. R is central to a lot of scientific
and statistical work, and is probably the premier open source statistics and
scientific graphics package.

R's own package handling system is ok, (though it is much easier to use on MS
Windows) including for example, semi-automatic updates. R currently has at least
three package repositories (CRAN, Bio-Conductor and Omega-Hat), and it would be
necessary to support the first two anyway. Also, note that R, that is the basic
R from gentoo, comes with the base packages installed already. R with no
packages does very little, kind of like Apache with no modules.

Most of R's key functions are in packages, and these always need perl, and
commonly need C or Fortran (g77 not f2c!).

I use perl a lot, and I really like the Gentoo approach to perl modules.
Something similar for R packages woud be very useful. I would be happy to test.

Details follow from CRAN (to save you looking it up):-

5.2 How can add-on packages be installed?

(Unix only.) The add-on packages on CRAN come as gzipped tar files named
pkg_version.tar.gz, which may in fact be 
Comment 2 Anthony Staines 2005-08-03 16:02:58 UTC
This would be a valuable addition to Gentoo. R is central to a lot of scientific
and statistical work, and is probably the premier open source statistics and
scientific graphics package.

R's own package handling system is ok, (though it is much easier to use on MS
Windows) including for example, semi-automatic updates. R currently has at least
three package repositories (CRAN, Bio-Conductor and Omega-Hat), and it would be
necessary to support the first two anyway. Also, note that R, that is the basic
R from gentoo, comes with the base packages installed already. R with no
packages does very little, kind of like Apache with no modules.

Most of R's key functions are in packages, and these always need perl, and
commonly need C or Fortran (g77 not f2c!).

I use perl a lot, and I really like the Gentoo approach to perl modules.
Something similar for R packages woud be very useful. I would be happy to test.

Details follow from CRAN (to save you looking it up):-

5.2 How can add-on packages be installed?

(Unix only.) The add-on packages on CRAN come as gzipped tar files named
pkg_version.tar.gz, which may in fact be bundles containing more than one
package. Provided that tar and gzip are available on your system, type

     $ R CMD INSTALL /path/to/pkg_version.tar.gz

at the shell prompt to install to the library tree rooted at the first directory
given in R_LIBS (see below) if this is set and non-null, and to the default
library (the library subdirectory of R_HOME) otherwise. (Versions of R prior to
1.3.0 installed to the default library by default.)

To install to another tree (e.g., your private one), use

     $ R CMD INSTALL -l lib /path/to/pkg_version.tar.gz

where lib gives the path to the library tree to install to.

Even more conveniently, you can install and automatically update packages from
within R if you have access to CRAN. See the help page for CRAN.packages() for
more information.

You can use several library trees of add-on packages. The easiest way to tell R
to use these is via the environment variable R_LIBS which should be a
colon-separated list of directories at which R library trees are rooted. You do
not have to specify the default tree in R_LIBS. E.g., to use a private tree in
$HOME/lib/R and a public site-wide tree in /usr/local/lib/R-contrib, put

     R_LIBS="$HOME/lib/R:/usr/local/lib/R-contrib"; export R_LIBS

into your (Bourne) shell profile or even preferably, add the line

     R_LIBS="~/lib/R:/usr/local/lib/R-contrib"

your ~/.Renviron file. (Note that no export statement is needed or allowed in
this file; see the on-line help for Startup for more information.)
[SNIP]

5.4 How can add-on packages be removed?

Use

     $ R CMD REMOVE pkg_1 ... pkg_n

to remove the packages pkg_1, ..., pkg_n from the library tree rooted at the
first directory given in R_LIBS if this is set and non-null, and from the
default library otherwise. (Versions of R prior to 1.3.0 removed from the
default library by default.)

To remove from library lib, do

     $ R CMD REMOVE -l lib pkg_1 ... pkg_n

Comment 3 KiTaSuMbA 2005-12-13 09:02:55 UTC
Should the internal R package handling work, it would still be ok. Troublesome
but OK. HOWEVER IT DOES NOT!!!

Having installed R-2.2.0 with portage, this is what I get when I try to install
an additional package:

/usr/lib/R/bin/INSTALL: line 119:
/var/tmp/portage/R-2.2.0/image//usr/lib/R/share/sh/dcf.sh: No such file or directory


Apparently, R keeps registered the build directory as its $R_HOME and even when
exported in the shell as the correct /usr/lib/R before executing the
installation command, R stubbornly IGNORES it and even tells you so!

# export R_HOME="/usr/lib/R/"; R CMD INSTALL /home/erebus/Rcmdr_1.1-4.tar.gz 
WARNING: ignoring environment value of R_HOME
/usr/lib/R/bin/INSTALL: line 119:
/var/tmp/portage/R-2.2.0/image//usr/lib/R/share/sh/dcf.sh: No such file or directory

I can only add that this is getting extremely frustrating!
Comment 4 KiTaSuMbA 2005-12-13 09:38:00 UTC
Solution to the problem above described submitted as bug #115430
Comment 5 Marcus D. Hanwell (RETIRED) gentoo-dev 2005-12-13 09:53:46 UTC
As I think you have already discovered dev-lang/R-2.2.0-r1 fixes this issue 
already - please report if you have any further issues. I think in most cases 
using the R package management should work fine, but may be we should consider 
an ebuild for what might be considered very useful packages as a tarball? I 
would be interested on thoughts and whether this would clash with the R system 
in place already. 
Comment 6 Marcus D. Hanwell (RETIRED) gentoo-dev 2005-12-13 09:57:33 UTC
The bug has already been addressed in bug 115140 - I thought that was what you  
were referring to.  
Comment 7 Danny van Dyk (RETIRED) gentoo-dev 2006-05-10 14:30:59 UTC
I have a patch for sys-apps/paludis to understand and use CRAN repositories.

You can find it at
http://dev.gentoo.org/~kugelfang/gentoo/misc/paludis-cran-repo.patch
Comment 8 Sébastien Fabbro (RETIRED) gentoo-dev 2010-05-25 16:36:27 UTC
now a Gentoo Google Summer of Code, cc-ing the student.
Comment 9 David Seifert gentoo-dev 2022-01-26 10:38:56 UTC
I'm going to close this bug. While this idea pops up once in a while, producing ebuilds for CRAN packages seems like a pipe-dream. The upkeep required to make this tractable is insurmountable in practice (just look at python and how we're struggling to keep stuff updated). Ideas are welcome, but they need to be fleshed out and tractable, and to date none have been so far.