[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: R packages are not recognized.
From: |
Ricardo Wurmus |
Subject: |
Re: R packages are not recognized. |
Date: |
Mon, 16 Sep 2024 19:42:51 +0200 |
Divya <divya@subvertising.org> writes:
> I installed R packages using `guix install`, `guix shell` or by adding them
> to my home configuration, but in none of those ways can I get
> my R system (which is also installed through guix using system configuration)
> can recognize those packages.
>
> What is going wrong?
R consults the value of the environment variable R_LIBS_SITE to
determine the list of directories to search for packages. When R is
installed with Guix into a profile, Guix generates an entry in
$GUIX_PROFILE/etc/profile that points R to the sub-directory of this
profile containing R packages.
When you install R packages into a separate profile (and without
"r-minimal" or "r") then the generated etc/profile file will not have an
entry for R_LIBS_SITE.
You can either set this value manually before launching R, use
`.libPath` inside an R session to augment the search path, or install R
(i.e. "r-minimal" or "r") alongside the packages you intend to use. You
can also use "guix shell" with a manifest containing both R and the
packages you need; Guix will set R_LIBS_SITE automatically in this case,
so that R inside of the Guix environment has access to all requested R
packages.
--
Ricardo