R Package Installation Ignores libPaths Setting

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

R Package Installation Ignores libPaths Setting

Dario Strbenac-2
Good day,

If the library path is changed with .libPaths, the command

install.packages("/nb/dario/Biostrings_2.39.9.tar.gz", repos=NULL)

fails with

** testing if installed package can be loaded
Error : package ‘S4Vectors’ required by ‘Biostrings’ could not be found

However,

running library(S4Vectors) followed by sessionInfo() after the error shows that the package can indeed be found by R

R version 3.2.3 Patched (2016-02-14 r70170)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
    ...        ...
other attached packages:
[1] S4Vectors_0.9.34    BiocGenerics_0.17.3

The new library path is being ignored when the package is attempted to be loaded at the end of the installation process. How can the installation be successful ?

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R Package Installation Ignores libPaths Setting

Prof Brian Ripley
You misunderstand what .libPaths does: it changes the path in the
current session only.  Installation uses a different R process.

Set R_LIBS to change the library path for new sessions: see ?.libPath .


On 18/02/2016 07:00, Dario Strbenac wrote:

> Good day,
>
> If the library path is changed with .libPaths, the command
>
> install.packages("/nb/dario/Biostrings_2.39.9.tar.gz", repos=NULL)
>
> fails with
>
> ** testing if installed package can be loaded
> Error : package ‘S4Vectors’ required by ‘Biostrings’ could not be found
>
> However,
>
> running library(S4Vectors) followed by sessionInfo() after the error shows that the package can indeed be found by R
>
> R version 3.2.3 Patched (2016-02-14 r70170)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Debian GNU/Linux 8 (jessie)
>      ...        ...
> other attached packages:
> [1] S4Vectors_0.9.34    BiocGenerics_0.17.3
>
> The new library path is being ignored when the package is attempted to be loaded at the end of the installation process. How can the installation be successful ?
>
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia


--
Brian D. Ripley,                  [hidden email]
Emeritus Professor of Applied Statistics, University of Oxford

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R Package Installation Ignores libPaths Setting

Dario Strbenac-2
Good day,

I believe from the documentation that folders in R_LIBS should appear in the output of .libPaths, but they do not. The documentation contains "The library search path is initialized at startup from the environment variable R_LIBS ..."

However,

$ export R_LIBS=/users/stgrad/dario/tmp/
$ Rscript -e ".libPaths()"
[1] "/dskh/nobackup/biostat/Bioconductor" "/usr/local/lib/R/site-library"      
[3] "/usr/lib/R/site-library"             "/usr/lib/R/library"

Is there some other crucial information which I have missed ?

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R Package Installation Ignores libPaths Setting

Peter Dalgaard-2
Works for me. Which shell are you using? Are you setting .libPaths elsewhere?

Peter-Dalgaards-MacBook-Air:F pd$ R_LIBS=~/tmp Rscript -e '.libPaths()'
[1] "/Users/pd/tmp"                                                
[2] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library"

Peter-Dalgaards-MacBook-Air:F pd$ export R_LIBS=~/tmp
Peter-Dalgaards-MacBook-Air:F pd$ Rscript -e '.libPaths()'
[1] "/Users/pd/tmp"                                                
[2] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library"

-pd

> On 20 Feb 2016, at 10:00 , Dario Strbenac <[hidden email]> wrote:
>
> Good day,
>
> I believe from the documentation that folders in R_LIBS should appear in the output of .libPaths, but they do not. The documentation contains "The library search path is initialized at startup from the environment variable R_LIBS ..."
>
> However,
>
> $ export R_LIBS=/users/stgrad/dario/tmp/
> $ Rscript -e ".libPaths()"
> [1] "/dskh/nobackup/biostat/Bioconductor" "/usr/local/lib/R/site-library"      
> [3] "/usr/lib/R/site-library"             "/usr/lib/R/library"
>
> Is there some other crucial information which I have missed ?
>
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R Package Installation Ignores libPaths Setting

Dario Strbenac-2
Good day,

Thank you for the suggestions. I had a .libPaths command in my .Rprofile file. I have now removed it and specified R_LIBS in .Renviron.

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel