[R] customizing library locations for R in ubuntu

ravi rv15| @end|ng |rom y@hoo@@e
Thu May 15 18:21:07 CEST 2025


I have now followed your advice and switched to the R-sig-debian help list.
Ravi
On Thursday, 15 May 2025 at 12:59:05 CEST, ravi <rv15i using yahoo.se> wrote: 

I did some googling and then ran:
> bspm::shadowed_packages()
     Package                 LibPath Version       Shadow.LibPath Shadow.Version Shadow.Newer
bspm    bspm /usr/lib/R/site-library   0.5.7 /home/ravi/rvi/Rlib          0.5.7        FALSE

I have a copy of bspm in the /usr/lib/R/site-library location as well, although that is not the 1st in my list of libPaths. This got included probably in a previous attempt in installing r2u. The package in the /usr/lib/R/site-library location has a lock icon associated with it. Is this intentional, or is it something that I should do something about? Which of the two copies of bspm should I delete?
Ravi

On Thursday, 15 May 2025 at 12:32:59 CEST, ravi <rv15i using yahoo.se> wrote: 





Thanks, Dirk for reaching out and helping me with these tips. I must first say that I am beginner to Ubuntu. I am a stranger to Docker and therefore to Rocker as well. I will try to read and follow up on these leads. For now, I am interested in r2u and would like to follow a more straightforward route.
I have tried to run the add_cranappt_noble.sh script:

sudo chmod -R a+rwx /home/rvi/Documents/Rcode/add_cranappt_noble.sh #found by trial and error  that this was necessary to run the script
sudo /home/rvi/Documents/Rcode/add_cranappt_noble.sh

Ithen got the following error:
> install.packages("stringi")

Error in install.packages : dbus: Call failed: Cannot launch daemon, file not found or permissions invalid

What should I do now?
My understanding is that the r2u project is to help in installing and updating R packages with ubuntu binaries. This is welcome because the installation of some packages takes too much time otherwise. Will this installation or update work via Rstudio, or will it only work via running r-cran-styringi on the terminal?
What is a simple test to determine that I have the r2u up and running?
Thanks, Ravi


On Wednesday, 14 May 2025 at 13:53:26 CEST, Dirk Eddelbuettel <edd using debian.org> wrote: 






On 9 May 2025 at 16:41, Ivan Krylov via R-help wrote:
| This is not guaranteed to work, especially for (but not limited to)
| packages that compile source code and link to various interfaces inside
| R: https://stat.ethz.ch/pipermail/r-help/2025-April/480832.html
| 
| This problem is more visible on Ubuntu than on Windows. On GNU/Linux
| systems, R packages will link to the third-party libraries you install
| from the GNU/Linux repositories. When you update your Ubuntu
| installation, the installed packages may stop working.

That is where an approach such as r2u [1] shines: it integrates the package
management with the system management.

So when you, say, install stringi, the system manager (apt) knows which
libicu* version you now depend on and will not remove it until all known uses
are upgraded to a new version of libicu*, for example by updating stringi via
the binary r-cran-stringi provided by r2u. Ditto for all other third-party
dependencies such as database, compression, graphics, ... libraries. Give it
a try, easy to do in a container such as rocker/r2u:24.04.

r2u can of course still be combined with user-local and/or system-local
library paths specific to local development, or non-CRAN packages, or ... 
Turning the helper package bspm off as in
  bspm::disable(); install.packages(pkgname

or  

  bspm::disable(); remotes::install_github(repo_and_package)
makes it works as it usually does (without system integration).  So a 'best
of both worlds' approach is available.

Cheers, Dirk

[1] See https://eddelbuettel.github.io/r2u for more

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



More information about the R-help mailing list