From edd @end|ng |rom deb|@n@org  Fri Nov 10 14:41:17 2023
From: edd @end|ng |rom deb|@n@org (Dirk Eddelbuettel)
Date: Fri, 10 Nov 2023 07:41:17 -0600
Subject: [Rd] 
 [R] Why Rprofile.site is not built with manual installation of
 R devel in linux?
In-Reply-To: <25934.11765.552272.1395@stat.math.ethz.ch>
References: <AM6PR02MB44230F37BC7E7A139581925F94AFA@AM6PR02MB4423.eurprd02.prod.outlook.com>
 <205A4E17-50C5-45F0-8D91-F400C1B89E6E@dcn.davis.ca.us>
 <25934.11765.552272.1395@stat.math.ethz.ch>
Message-ID: <25934.13053.707608.395510@rob.eddelbuettel.com>


On 10 November 2023 at 14:19, Martin Maechler wrote:
|     >> 2.  In the installed R in /where/you/want/R/to/go, there is no even etc folder, there are only the folders bin, lib and share.

That would appear to be an error in the locally installed R.

What the package does has been discussed before. Per the Linux Filesystem
Standard (or Filesystem Hierarchy or whatever it is called), Linux distro
such as Debian and Ubuntu use _both_ /usr/lib _and_ /usr/share so the
directories are split. Use the `R.home()` function to find them:

    $ Rscript -e 'sapply(c("bin", "doc", "etc"), R.home)'
                   bin                doc                etc 
      "/usr/lib/R/bin" "/usr/share/R/doc"   "/usr/lib/R/etc" 
    $ 

That is from the packaged R via r-base-core.

The behaviour can easily be validated by invoking, say, a Docker container
based on these same (Debian) packages. One of the containers I look after in
the Rocker Project has also been aliased to just 'r-base' for years by Docker
itself so just prefix the above by 'docker run --rm -ti r-base' to run in a
clean container:

    $ docker run --rm -ti r-base Rscript -e 'sapply(c("bin", "doc", "etc"), R.home)'
                   bin                doc                etc 
      "/usr/lib/R/bin" "/usr/share/R/doc"   "/usr/lib/R/etc" 
    $ 

Being able to run Docker for such tests is a good superpower and on most
systems these days only one package installation away.

For a locally built one (my r-devel build here) it works the same but points
of course to a different directory:

    $ RDscript -e 'sapply(c("bin", "doc", "etc"), R.home)'
                                   bin                                doc
    "/usr/local/lib/R-devel/lib/R/bin" "/usr/local/lib/R-devel/lib/R/doc"
                                   etc 
    "/usr/local/lib/R-devel/lib/R/etc"
    $ 

As suggested, question for 'R on Debian, Ubuntu, ...' should probably go to
r-sig-debian which is now CCed.  As usual, you must be subscribed to post or
else you will get mistaken for a spammer and ignored.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] [R] Why Rprofile.site is not built with manual installation of R devel in linux?
Dirk Eddelbuettel