[Rd] Windows 7 and .libPaths()

Duncan Murdoch murdoch.duncan at gmail.com
Mon Aug 6 14:12:55 CEST 2012


On 12-08-06 6:09 AM, Rui Barradas wrote:
> Hello,
>
> I'm having some trouble trying to set the .libPaths() on Windows 7,
> R-2.15.0 and R-2.15.1. The environment variables R_LIBS and R_LIBS_USER
> are set according to the help page for .libPaths() and the Rprofile.site
> file has the default setting, as shown below. R-2.14.1 recognizes the
> lib paths but not R-2.15. Is this a bug or am I doing something wrong?

There's at least one typo below, but besides that, it's hard to tell. 
Do the directories you're trying to set exist?  More inline.

> (I've also tried with R-2.12.0 and R-2.13.0 and it works as documented
> but I only show here the output for R-2.14.1, R-2.15.0 and R-2.15.1)
>
> First, the Windows settings.
>
> Microsoft Windows [Versão 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.
>
> C:\Users\Rui>echo %R_LIBS%
> C:/PROGRA~1/R/win-library;

I don't think the terminal semicolon is needed, though it shouldn't 
cause a problem.

>
> C:\Users\Rui>echo %R_LIBS_USER%
> C:/PROGRA~1/R/win-library;C:/PROGRA~1/R/win-library/%v;

Does C:/PROGRA~1/R/win-library exist?  Does 
C:/PROGRA~1/R/win-library/2.5 exist?  Does 
normalizePath("C:/PROGRA~1/R/win-library", winslash="/") give a 
directory that exists?

>
> Then, file Rprofile.site .
>
> # set libPath to win-library
> .libPaths(new="C:PROGRA~1/R/win-library")
> .libPaths(new=paste("C:PROGRA~1/R/win-library",
> paste(R.version$major,as.integer(R.version$minor),sep='.'), sep="/"))

These lines have the typo:  it should be C:/PROGRA~1, not C:PROGRA~1.

>
> Finally, three R sessions.
>
> #--------- R-2.14.1
>
>   > .libPaths()
> [1] "C:/Program Files/R/win-library"      "C:/Program
> Files/R/win-library/2.14"
> [3] "C:/Program Files/R/R-2.14.1/library"
>   >
>   > sessionInfo()
> R version 2.14.1 (2011-12-22)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252
> [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
> [5] LC_TIME=Portuguese_Portugal.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> #--------- R-2.15.0
>
>   > .libPaths()
> [1] "C:/Program Files/R/R-2.15.0/library"
>   >
>   > sessionInfo()
> R version 2.15.0 (2012-03-30)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252
> [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
> [5] LC_TIME=Portuguese_Portugal.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> #--------- R-2.15.1
>
>   > .libPaths()
> [1] "C:/Program Files/R/R-2.15.1/library"
>   >
>   > sessionInfo()
> R version 2.15.1 (2012-06-22)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252
> [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
> [5] LC_TIME=Portuguese_Portugal.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods base
>
> loaded via a namespace (and not attached):
> [1] fortunes_1.5-0
>
>
> Rui Barradas
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



More information about the R-devel mailing list