gmbecker / switchr

An R package for managing and seamlessly switching between sets of installed R packages.
http://google.com AND http://blabla.com
58 stars 6 forks source link

switchTo session info example #3

Open AugustT opened 9 years ago

AugustT commented 9 years ago

When running:

library(switchr)
library(nlme)
txt = capture.output(print(sessionInfo()))
switchTo("SInfoTest", seed = txt)

I get:

Error in rawToChar(block[seq_len(ns)]) : 
  embedded nul in string:     'PK\003\004\n\0\0\0\0\0nš†F\0\0\0\0\0\0\0\0\0\0\0\0\005\0\0\0nlme/PK\003\004\024\0\002\0\b\0bš†FhU\    036ö\024\001\0\0\017\002\0\0\r\0\0\0nlme/CITATION…QÁjÃ0\f½ç+„Ù \031Mr/Ë¡kw\031'
In addition: Warning message:
In dir.create(repdir, recursive = TRUE) :
  'C:\Users\tomaug\AppData\Local\Temp\RtmpuEJHAX\repo\src\contrib' already exists
AugustT commented 9 years ago

For info this is the environment I'm trying to recreate (copied from the PDF document):

## R version 3.0.2 (2013-09-25)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
##
## locale:
## [1] LC_COLLATE=English_United Kingdom.1252
## [2] LC_CTYPE=English_United Kingdom.1252
## [3] LC_MONETARY=English_United Kingdom.1252
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United Kingdom.1252
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggplot2_0.9.3.1 R2jags_0.03-12 rjags_3-12 coda_0.16-1
## [5] lattice_0.20-29 lme4_1.1-5 Rcpp_0.11.1 Matrix_1.1-2
## [9] reshape2_1.2.2 knitr_1.5
##
## loaded via a namespace (and not attached):
## [1] abind_1.4-0 boot_1.3-9 colorspace_1.2-4
## [4] dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1
## [7] formatR_0.10 grid_3.0.2 gtable_0.1.2
## [10] highr_0.3 labeling_0.2 MASS_7.3-29
## [13] minqa_1.2.3 munsell_0.4.2 nlme_3.1-111
## [16] parallel_3.0.2 plyr_1.8.1 proto_0.3-10
## [19] R2WinBUGS_2.1-19 RColorBrewer_1.0-5 RcppEigen_0.3.2.0.2
## [22] scales_0.2.3 splines_3.0.2 stringr_0.6.2
## [25] tools_3.0.2

Which comes from here, the supplementary materials to a paper: http://onlinelibrary.wiley.com/store/10.1111/2041-210X.12254/asset/supinfo/mee312254-sup-0002-AppendixS2.pdf?v=1&s=c3e0052b75fe437a285aa9eb0c2c266bfc5c99fc

gmbecker commented 9 years ago

@AugustT Upon further investigation, I have been able to recreate this. It arises from the fact that R packages are built differently for windows than Linux (the system I developed switchr on). I'm generalizing the code so a fix should land today.

gmbecker commented 9 years ago

@AugustT I have just committed a bunch of fixes which should allow switchr to behave on Windows, provided that the system is configured to build all the packages in question from source. Direct support of binary packages isn't in currently, and will always be somewhat spotty because the Archive doesn't track all version of binary packages, and it doesn't make sense anyway when installing from non-repository sources.

Please let me know if the latest version (0.5.13) works for you on windows, and if not what problems you run into. Thanks for the interest and bug reports.

AugustT commented 9 years ago

@gmbecker

So here is my test of the simple example:

> # library(devtools)
> # install_github('gmbecker/switchr')
> 
> # Set R to install source by default
> options(pkgType = 'source')
> 
> ## Simple test ##
> ## This seems to work with one warning ##
> library(nlme)
> txt = capture.output(print(sessionInfo()))
> print(txt)
[1] "R version 3.1.3 (2015-03-09)"                            
[2] "Platform: x86_64-w64-mingw32/x64 (64-bit)"               
[3] "Running under: Windows 7 x64 (build 7601) Service Pack 1"
[4] ""                                                        
[5] "locale:"                                                 
[6] "[1] LC_COLLATE=English_United Kingdom.1252 "             
[7] "[2] LC_CTYPE=English_United Kingdom.1252   "             
[8] "[3] LC_MONETARY=English_United Kingdom.1252"             
[9] "[4] LC_NUMERIC=C                           "             
[10] "[5] LC_TIME=English_United Kingdom.1252    "             
[11] ""                                                        
[12] "attached base packages:"                                 
[13] "[1] stats     graphics  grDevices utils     datasets "   
[14] "[6] methods   base     "                                 
[15] ""                                                        
[16] "other attached packages:"                                
[17] "[1] nlme_3.1-120"                                        
[18] ""                                                        
[19] "loaded via a namespace (and not attached):"              
[20] "[1] grid_3.1.3      lattice_0.20-30 tools_3.1.3    "     
> library(switchr)
> switchTo("nlmeTest", seed = txt)
trying URL 'http://cran.rstudio.com/src/contrib/nlme_3.1-120.tar.gz'
Content type 'application/x-gzip' length 759588 bytes (741 KB)
opened URL
downloaded 741 KB

trying URL 'http://cran.r-project.org/src/contrib/Archive/lattice/lattice_0.20-30.tar.gz'
Content type 'application/x-gzip' length 353130 bytes (344 KB)
opened URL
downloaded 344 KB

Switched to the 'nlmeTest' computing environment. 30 packages are currently available. Packages installed in your site library ARE suppressed.
To switch back to your previous environment type switchBack()
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:\Users\tomaug\AppData\Local\Temp\RtmpWi238E/repo/src/contrib": The system cannot find the path specified
> switchBack()
Reverted to the 'original' computing environment. 186 packages are currently available. Packages installed in your site library ARE NOT suppressed.
To switch back to your previous environment type switchBack()

This produces a warning but I'm not sure how much of a deal that is?

AugustT commented 9 years ago

@gmbecker Here is a more complex example (the one that I need to run)

> ## More complex test ##
> sesstxt <- "R version 3.0.2 (2013-09-25)
+ Platform: x86_64-w64-mingw32/x64 (64-bit)
+ 
+ locale:
+ LC_COLLATE=English_United Kingdom.1252
+ LC_CTYPE=English_United Kingdom.1252
+ LC_MONETARY=English_United Kingdom.1252
+ LC_NUMERIC=C
+ LC_TIME=English_United Kingdom.1252
+ 
+ attached base packages:
+ stats graphics grDevices utils datasets methods base
+ 
+ other attached packages:
+ ggplot2_0.9.3.1 R2jags_0.03-12 rjags_3-12 coda_0.16-1
+ lattice_0.20-29 lme4_1.1-5 Rcpp_0.11.1 Matrix_1.1-2
+ reshape2_1.2.2 knitr_1.5
+ 
+ loaded via a namespace (and not attached):
+ abind_1.4-0 boot_1.3-9 colorspace_1.2-4
+ dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1
+ formatR_0.10 grid_3.0.2 gtable_0.1.2
+ highr_0.3 labeling_0.2 MASS_7.3-29
+ minqa_1.2.3 munsell_0.4.2 nlme_3.1-111
+ parallel_3.0.2 plyr_1.8.1 proto_0.3-10
+ R2WinBUGS_2.1-19 RColorBrewer_1.0-5 RcppEigen_0.3.2.0.2
+ scales_0.2.3 splines_3.0.2 stringr_0.6.2
+ tools_3.0.2"
> 
> # This needs to be formatted to match txt above
> sesstxt <- strsplit(sesstxt, split = '\n')[[1]]
> print(sesstxt)
 [1] "R version 3.0.2 (2013-09-25)"                           
 [2] "Platform: x86_64-w64-mingw32/x64 (64-bit)"              
 [3] ""                                                       
 [4] "locale:"                                                
 [5] "LC_COLLATE=English_United Kingdom.1252"                 
 [6] "LC_CTYPE=English_United Kingdom.1252"                   
 [7] "LC_MONETARY=English_United Kingdom.1252"                
 [8] "LC_NUMERIC=C"                                           
 [9] "LC_TIME=English_United Kingdom.1252"                    
[10] ""                                                       
[11] "attached base packages:"                                
[12] "stats graphics grDevices utils datasets methods base"   
[13] ""                                                       
[14] "other attached packages:"                               
[15] "ggplot2_0.9.3.1 R2jags_0.03-12 rjags_3-12 coda_0.16-1"  
[16] "lattice_0.20-29 lme4_1.1-5 Rcpp_0.11.1 Matrix_1.1-2"    
[17] "reshape2_1.2.2 knitr_1.5"                               
[18] ""                                                       
[19] "loaded via a namespace (and not attached):"             
[20] "abind_1.4-0 boot_1.3-9 colorspace_1.2-4"                
[21] "dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1"            
[22] "formatR_0.10 grid_3.0.2 gtable_0.1.2"                   
[23] "highr_0.3 labeling_0.2 MASS_7.3-29"                     
[24] "minqa_1.2.3 munsell_0.4.2 nlme_3.1-111"                 
[25] "parallel_3.0.2 plyr_1.8.1 proto_0.3-10"                 
[26] "R2WinBUGS_2.1-19 RColorBrewer_1.0-5 RcppEigen_0.3.2.0.2"
[27] "scales_0.2.3 splines_3.0.2 stringr_0.6.2"               
[28] "tools_3.0.2"                                            
> 
> # Do the switch
> switchTo("SimsTest", seed = sesstxt)
trying URL 'http://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_0.9.3.1.tar.gz'
Content type 'application/x-gzip' length 2330942 bytes (2.2 MB)
opened URL
downloaded 2.2 MB

This Downloading goes on for a while...

trying URL 'http://cran.rstudio.com/src/contrib/stringr_0.6.2.tar.gz'
Content type 'application/x-gzip' length 20636 bytes (20 KB)
opened URL
downloaded 20 KB

Switched to the 'SimsTest' computing environment. 48 packages are currently available. Packages installed in your site library ARE suppressed.
 To switch back to your previous environment type switchBack()
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\tomaug\AppData\Local\Temp\RtmpOIsmV6/repo/src/contrib": The system cannot find the path specified
> 
> # Try loading a package
> library(plyr)
Error in library(plyr) : there is no package called ‘plyr’
> library(ggplot2)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘digest’
Error: package or namespace load failed for ‘ggplot2’
> library(knitr)

So the knitr package will load but numerous others won't, I have looked in 'C:\Users\tomaug\AppData\Local\Temp\RtmpOIsmV6' and all of these packages are present there. Also the subdirectory 'repo\src\contrib' does exist, but perhaps your mixing of '/' and '\' is causing problems?

Thank you for working on this, I think this package shows real promise!

gmbecker commented 9 years ago

@AugustT The warning is annoying, and I will squash it soon, but it is ultimately meaningless. It just means that [edited] R is normalizing the path before that directory is created, and it is "helpfully" informing us that the normalized path doesn't point to anything.[end edited] No problems with functionality are arising from that.

Just to confirm, , if you do

switchTo("SimsTest")
installed.packages()[,"Package"]

plyr is not listed as installed?

Also, can you give me the results of

list.files("~/.switchr/SimsTest")

please?

AugustT commented 9 years ago

@gmbecker Good to hear that warning is not causeing any issues.

Here are the results you asked for:

> switchTo("SimsTest")
Switched to the 'SimsTest' computing environment. 48 packages are currently available. Packages installed in your site library ARE suppressed.
 To switch back to your previous environment type switchBack()
> installed.packages()[,"Package"]
         abind           boot           coda 
       "abind"         "boot"         "coda" 
     dichromat       evaluate        formatR 
   "dichromat"     "evaluate"      "formatR" 
       ggplot2         gtable          highr 
     "ggplot2"       "gtable"        "highr" 
         knitr       labeling        munsell 
       "knitr"     "labeling"      "munsell" 
         proto         R2jags      R2WinBUGS 
       "proto"       "R2jags"    "R2WinBUGS" 
  RColorBrewer       reshape2         scales 
"RColorBrewer"     "reshape2"       "scales" 
       stringr           base           boot 
     "stringr"         "base"         "boot" 
         class        cluster      codetools 
       "class"      "cluster"    "codetools" 
      compiler       datasets        foreign 
    "compiler"     "datasets"      "foreign" 
      graphics      grDevices           grid 
    "graphics"    "grDevices"         "grid" 
    KernSmooth        lattice           MASS 
  "KernSmooth"      "lattice"         "MASS" 
        Matrix        methods           mgcv 
      "Matrix"      "methods"         "mgcv" 
          nlme           nnet       parallel 
        "nlme"         "nnet"     "parallel" 
         rpart        spatial        splines 
       "rpart"      "spatial"      "splines" 
         stats         stats4       survival 
       "stats"       "stats4"     "survival" 
         tcltk          tools   translations 
       "tcltk"        "tools" "translations" 
         utils 
       "utils" 
> list.files("~/.switchr/SimsTest")
 [1] "abind"        "boot"         "coda"        
 [4] "dichromat"    "evaluate"     "formatR"     
 [7] "ggplot2"      "gtable"       "highr"       
[10] "knitr"        "labeling"     "lib_info"    
[13] "munsell"      "proto"        "R2jags"      
[16] "R2WinBUGS"    "RColorBrewer" "reshape2"    
[19] "scales"       "stringr"     
gmbecker commented 9 years ago

@AugustT Sorry for the delay in response.

I'm not seeing this behavior in either windows (using R studio) or linux. In both cases plyr is installed and ggplot is loadable. Is it possible you had intermittent internet problems? Switchr is not currently robust to that (and I'm not sure how to change that, though I can think about possible ways).

Are there warnings at the end of the (very long) switchTo output of the following form for the missing packages?

5: running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\beckerg4\.switchr\winbugtst" C:\Users\beckerg4\AppData\Local\Temp\Rtmp2NkAEY\repo\src\contrib/rjags_3-12.tar.gz' had status 1 
6: In utils::install.packages(pkgs, available = avail, ...) :
  installation of package ‘rjags’ had non-zero exit status

Can you try this again and post a capture of all output (as a file is fine) and the output from warnings()?

You'll need to call removeLib("SimsTest") to remove the existing switchr library so that you can start again "from scratch". Also, this probably isn't an issue, but please do so in a fresh R session, not one that has been running since the last time you tried.

gmbecker commented 9 years ago

@AugustT I have added some timeouts/retries when retrieving packages from the CRAN Archive, which seems to occasionally (and randomly) have trouble. This should (I hope) fix the issue that you saw.

Also, FYI, the knitr package version in your session info will fail to install, but that is because it was actually invalid. It claimed a package (markdown) as Imports, but its NAMESPACE didn't import it, so it wasn't in the sessionInfo. Despite this, it will fail to install if the markdown package is not installed. Unfortunately, it is it is (nearly) impossible to determine which version of the markdown package that version of knitr wants, so switchr doesn't current do that when switching to a sessionInfo. The assumption is that all packages necessary to both install and load the package are listed in the sessionInfo text.

AugustT commented 9 years ago

First let me say that we had a chat about your package at our workshop on open science and reproducibility and the group (UK Macroecologists) thought it sounded like a good tool for ensuring reproducibility of our science.

Okay, @gmbecker here is my script (finally figured out how to get the markdown to work!)

# library(devtools)
# install_github('gmbecker/switchr')

# Set R to install source by default
options(pkgType = 'source')

# Load switchr
library(switchr)

## More complex test ##
sesstxt <- "R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
LC_COLLATE=English_United Kingdom.1252
LC_CTYPE=English_United Kingdom.1252
LC_MONETARY=English_United Kingdom.1252
LC_NUMERIC=C
LC_TIME=English_United Kingdom.1252

attached base packages:
stats graphics grDevices utils datasets methods base

other attached packages:
ggplot2_0.9.3.1 R2jags_0.03-12 rjags_3-12 coda_0.16-1
lattice_0.20-29 lme4_1.1-5 Rcpp_0.11.1 Matrix_1.1-2
reshape2_1.2.2 knitr_1.5

loaded via a namespace (and not attached):
abind_1.4-0 boot_1.3-9 colorspace_1.2-4
dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1
formatR_0.10 grid_3.0.2 gtable_0.1.2
highr_0.3 labeling_0.2 MASS_7.3-29
minqa_1.2.3 munsell_0.4.2 nlme_3.1-111
parallel_3.0.2 plyr_1.8.1 proto_0.3-10
R2WinBUGS_2.1-19 RColorBrewer_1.0-5 RcppEigen_0.3.2.0.2
scales_0.2.3 splines_3.0.2 stringr_0.6.2
tools_3.0.2"

# This needs to be formatted to match txt above
sesstxt <- strsplit(sesstxt, split = '\n')[[1]]
print(sesstxt)

# Do the switch
switchTo("SimsTest", seed = sesstxt)

# Try loading a package
library(plyr)
library(ggplot2)
library(knitr)

And here it the console output (couldn't figure out how to attach as a file):

R version 3.2.0 (2015-04-16) -- "Full of Ingredients"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> # library(devtools)
> # install_github('gmbecker/switchr')
> 
> # Set R to install source by default
> options(pkgType = 'source')
> 
> # Load switchr
> library(switchr)
> 
> ## More complex test ##
> sesstxt <- "R version 3.0.2 (2013-09-25)
+ Platform: x86_64-w64-mingw32/x64 (64-bit)
+ 
+ locale:
+ LC_COLLATE=English_United Kingdom.1252
+ LC_CTYPE=English_United Kingdom.1252
+ LC_MONETARY=English_United Kingdom.1252
+ LC_NUMERIC=C
+ LC_TIME=English_United Kingdom.1252
+ 
+ attached base packages:
+ stats graphics grDevices utils datasets methods base
+ 
+ other attached packages:
+ ggplot2_0.9.3.1 R2jags_0.03-12 rjags_3-12 coda_0.16-1
+ lattice_0.20-29 lme4_1.1-5 Rcpp_0.11.1 Matrix_1.1-2
+ reshape2_1.2.2 knitr_1.5
+ 
+ loaded via a namespace (and not attached):
+ abind_1.4-0 boot_1.3-9 colorspace_1.2-4
+ dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1
+ formatR_0.10 grid_3.0.2 gtable_0.1.2
+ highr_0.3 labeling_0.2 MASS_7.3-29
+ minqa_1.2.3 munsell_0.4.2 nlme_3.1-111
+ parallel_3.0.2 plyr_1.8.1 proto_0.3-10
+ R2WinBUGS_2.1-19 RColorBrewer_1.0-5 RcppEigen_0.3.2.0.2
+ scales_0.2.3 splines_3.0.2 stringr_0.6.2
+ tools_3.0.2"
> 
> # This needs to be formatted to match txt above
> sesstxt <- strsplit(sesstxt, split = '\n')[[1]]
> print(sesstxt)
 [1] "R version 3.0.2 (2013-09-25)"                           
 [2] "Platform: x86_64-w64-mingw32/x64 (64-bit)"              
 [3] ""                                                       
 [4] "locale:"                                                
 [5] "LC_COLLATE=English_United Kingdom.1252"                 
 [6] "LC_CTYPE=English_United Kingdom.1252"                   
 [7] "LC_MONETARY=English_United Kingdom.1252"                
 [8] "LC_NUMERIC=C"                                           
 [9] "LC_TIME=English_United Kingdom.1252"                    
[10] ""                                                       
[11] "attached base packages:"                                
[12] "stats graphics grDevices utils datasets methods base"   
[13] ""                                                       
[14] "other attached packages:"                               
[15] "ggplot2_0.9.3.1 R2jags_0.03-12 rjags_3-12 coda_0.16-1"  
[16] "lattice_0.20-29 lme4_1.1-5 Rcpp_0.11.1 Matrix_1.1-2"    
[17] "reshape2_1.2.2 knitr_1.5"                               
[18] ""                                                       
[19] "loaded via a namespace (and not attached):"             
[20] "abind_1.4-0 boot_1.3-9 colorspace_1.2-4"                
[21] "dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1"            
[22] "formatR_0.10 grid_3.0.2 gtable_0.1.2"                   
[23] "highr_0.3 labeling_0.2 MASS_7.3-29"                     
[24] "minqa_1.2.3 munsell_0.4.2 nlme_3.1-111"                 
[25] "parallel_3.0.2 plyr_1.8.1 proto_0.3-10"                 
[26] "R2WinBUGS_2.1-19 RColorBrewer_1.0-5 RcppEigen_0.3.2.0.2"
[27] "scales_0.2.3 splines_3.0.2 stringr_0.6.2"               
[28] "tools_3.0.2"                                            
> 
> # Do the switch
> switchTo("SimsTest", seed = sesstxt)
 [1] "ggplot2"      "R2jags"       "rjags"        "coda"        
 [5] "lattice"      "lme4"         "Rcpp"         "Matrix"      
 [9] "reshape2"     "knitr"        "abind"        "boot"        
[13] "colorspace"   "dichromat"    "digest"       "evaluate"    
[17] "formatR"      "gtable"       "highr"        "labeling"    
[21] "MASS"         "minqa"        "munsell"      "nlme"        
[25] "plyr"         "proto"        "R2WinBUGS"    "RColorBrewer"
[29] "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_0.9.3.1.tar.gz'
Content type 'application/x-gzip' length 2330942 bytes (2.2 MB)
downloaded 2.2 MB

 [1] "R2jags"       "rjags"        "coda"         "lattice"     
 [5] "lme4"         "Rcpp"         "Matrix"       "reshape2"    
 [9] "knitr"        "abind"        "boot"         "colorspace"  
[13] "dichromat"    "digest"       "evaluate"     "formatR"     
[17] "gtable"       "highr"        "labeling"     "MASS"        
[21] "minqa"        "munsell"      "nlme"         "plyr"        
[25] "proto"        "R2WinBUGS"    "RColorBrewer" "RcppEigen"   
[29] "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/R2jags/R2jags_0.03-12.tar.gz'
Content type 'application/x-gzip' length 28866 bytes (28 KB)
downloaded 28 KB

 [1] "rjags"        "coda"         "lattice"      "lme4"        
 [5] "Rcpp"         "Matrix"       "reshape2"     "knitr"       
 [9] "abind"        "boot"         "colorspace"   "dichromat"   
[13] "digest"       "evaluate"     "formatR"      "gtable"      
[17] "highr"        "labeling"     "MASS"         "minqa"       
[21] "munsell"      "nlme"         "plyr"         "proto"       
[25] "R2WinBUGS"    "RColorBrewer" "RcppEigen"    "scales"      
[29] "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/rjags/rjags_3-12.tar.gz'
Content type 'application/x-gzip' length 66744 bytes (65 KB)
downloaded 65 KB

 [1] "coda"         "lattice"      "lme4"         "Rcpp"        
 [5] "Matrix"       "reshape2"     "knitr"        "abind"       
 [9] "boot"         "colorspace"   "dichromat"    "digest"      
[13] "evaluate"     "formatR"      "gtable"       "highr"       
[17] "labeling"     "MASS"         "minqa"        "munsell"     
[21] "nlme"         "plyr"         "proto"        "R2WinBUGS"   
[25] "RColorBrewer" "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/coda/coda_0.16-1.tar.gz'
Content type 'application/x-gzip' length 74195 bytes (72 KB)
downloaded 72 KB

 [1] "lattice"      "lme4"         "Rcpp"         "Matrix"      
 [5] "reshape2"     "knitr"        "abind"        "boot"        
 [9] "colorspace"   "dichromat"    "digest"       "evaluate"    
[13] "formatR"      "gtable"       "highr"        "labeling"    
[17] "MASS"         "minqa"        "munsell"      "nlme"        
[21] "plyr"         "proto"        "R2WinBUGS"    "RColorBrewer"
[25] "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/lattice/lattice_0.20-29.tar.gz'
Content type 'application/x-gzip' length 347091 bytes (338 KB)
downloaded 338 KB

 [1] "lme4"         "Rcpp"         "Matrix"       "reshape2"    
 [5] "knitr"        "abind"        "boot"         "colorspace"  
 [9] "dichromat"    "digest"       "evaluate"     "formatR"     
[13] "gtable"       "highr"        "labeling"     "MASS"        
[17] "minqa"        "munsell"      "nlme"         "plyr"        
[21] "proto"        "R2WinBUGS"    "RColorBrewer" "RcppEigen"   
[25] "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/lme4/lme4_1.1-5.tar.gz'
Content type 'application/x-gzip' length 3235232 bytes (3.1 MB)
downloaded 3.1 MB

 [1] "Rcpp"         "Matrix"       "reshape2"     "knitr"       
 [5] "abind"        "boot"         "colorspace"   "dichromat"   
 [9] "digest"       "evaluate"     "formatR"      "gtable"      
[13] "highr"        "labeling"     "MASS"         "minqa"       
[17] "munsell"      "nlme"         "plyr"         "proto"       
[21] "R2WinBUGS"    "RColorBrewer" "RcppEigen"    "scales"      
[25] "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/Rcpp/Rcpp_0.11.1.tar.gz'
Content type 'application/x-gzip' length 2003515 bytes (1.9 MB)
downloaded 1.9 MB

 [1] "Matrix"       "reshape2"     "knitr"        "abind"       
 [5] "boot"         "colorspace"   "dichromat"    "digest"      
 [9] "evaluate"     "formatR"      "gtable"       "highr"       
[13] "labeling"     "MASS"         "minqa"        "munsell"     
[17] "nlme"         "plyr"         "proto"        "R2WinBUGS"   
[21] "RColorBrewer" "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/Matrix/Matrix_1.1-2.tar.gz'
Content type 'application/x-gzip' length 1635852 bytes (1.6 MB)
downloaded 1.6 MB

 [1] "reshape2"     "knitr"        "abind"        "boot"        
 [5] "colorspace"   "dichromat"    "digest"       "evaluate"    
 [9] "formatR"      "gtable"       "highr"        "labeling"    
[13] "MASS"         "minqa"        "munsell"      "nlme"        
[17] "plyr"         "proto"        "R2WinBUGS"    "RColorBrewer"
[21] "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/reshape2/reshape2_1.2.2.tar.gz'
Content type 'application/x-gzip' length 27220 bytes (26 KB)
downloaded 26 KB

 [1] "knitr"        "abind"        "boot"         "colorspace"  
 [5] "dichromat"    "digest"       "evaluate"     "formatR"     
 [9] "gtable"       "highr"        "labeling"     "MASS"        
[13] "minqa"        "munsell"      "nlme"         "plyr"        
[17] "proto"        "R2WinBUGS"    "RColorBrewer" "RcppEigen"   
[21] "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/knitr/knitr_1.5.tar.gz'
Content type 'application/x-gzip' length 737538 bytes (720 KB)
downloaded 720 KB

 [1] "abind"        "boot"         "colorspace"   "dichromat"   
 [5] "digest"       "evaluate"     "formatR"      "gtable"      
 [9] "highr"        "labeling"     "MASS"         "minqa"       
[13] "munsell"      "nlme"         "plyr"         "proto"       
[17] "R2WinBUGS"    "RColorBrewer" "RcppEigen"    "scales"      
[21] "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/abind/abind_1.4-0.tar.gz'
Content type 'application/x-gzip' length 19642 bytes (19 KB)
downloaded 19 KB

 [1] "boot"         "colorspace"   "dichromat"    "digest"      
 [5] "evaluate"     "formatR"      "gtable"       "highr"       
 [9] "labeling"     "MASS"         "minqa"        "munsell"     
[13] "nlme"         "plyr"         "proto"        "R2WinBUGS"   
[17] "RColorBrewer" "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/boot/boot_1.3-9.tar.gz'
Content type 'application/x-gzip' length 231614 bytes (226 KB)
downloaded 226 KB

 [1] "colorspace"   "dichromat"    "digest"       "evaluate"    
 [5] "formatR"      "gtable"       "highr"        "labeling"    
 [9] "MASS"         "minqa"        "munsell"      "nlme"        
[13] "plyr"         "proto"        "R2WinBUGS"    "RColorBrewer"
[17] "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/colorspace/colorspace_1.2-4.tar.gz'
Content type 'application/x-gzip' length 242791 bytes (237 KB)
downloaded 237 KB

 [1] "dichromat"    "digest"       "evaluate"     "formatR"     
 [5] "gtable"       "highr"        "labeling"     "MASS"        
 [9] "minqa"        "munsell"      "nlme"         "plyr"        
[13] "proto"        "R2WinBUGS"    "RColorBrewer" "RcppEigen"   
[17] "scales"       "stringr"     
trying URL 'http://cran.rstudio.com/src/contrib/dichromat_2.0-0.tar.gz'
Content type 'application/x-gzip' length 84320 bytes (82 KB)
downloaded 82 KB

 [1] "digest"       "evaluate"     "formatR"      "gtable"      
 [5] "highr"        "labeling"     "MASS"         "minqa"       
 [9] "munsell"      "nlme"         "plyr"         "proto"       
[13] "R2WinBUGS"    "RColorBrewer" "RcppEigen"    "scales"      
[17] "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/digest/digest_0.6.4.tar.gz'
Content type 'application/x-gzip' length 79309 bytes (77 KB)
downloaded 77 KB

 [1] "evaluate"     "formatR"      "gtable"       "highr"       
 [5] "labeling"     "MASS"         "minqa"        "munsell"     
 [9] "nlme"         "plyr"         "proto"        "R2WinBUGS"   
[13] "RColorBrewer" "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/evaluate/evaluate_0.5.1.tar.gz'
Content type 'application/x-gzip' length 17396 bytes (16 KB)
downloaded 16 KB

 [1] "formatR"      "gtable"       "highr"        "labeling"    
 [5] "MASS"         "minqa"        "munsell"      "nlme"        
 [9] "plyr"         "proto"        "R2WinBUGS"    "RColorBrewer"
[13] "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/formatR/formatR_0.10.tar.gz'
Content type 'application/x-gzip' length 27250 bytes (26 KB)
downloaded 26 KB

 [1] "gtable"       "highr"        "labeling"     "MASS"        
 [5] "minqa"        "munsell"      "nlme"         "plyr"        
 [9] "proto"        "R2WinBUGS"    "RColorBrewer" "RcppEigen"   
[13] "scales"       "stringr"     
trying URL 'http://cran.rstudio.com/src/contrib/gtable_0.1.2.tar.gz'
Content type 'application/x-gzip' length 19667 bytes (19 KB)
downloaded 19 KB

 [1] "highr"        "labeling"     "MASS"         "minqa"       
 [5] "munsell"      "nlme"         "plyr"         "proto"       
 [9] "R2WinBUGS"    "RColorBrewer" "RcppEigen"    "scales"      
[13] "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/highr/highr_0.3.tar.gz'
Content type 'application/x-gzip' length 16400 bytes (16 KB)
downloaded 16 KB

 [1] "labeling"     "MASS"         "minqa"        "munsell"     
 [5] "nlme"         "plyr"         "proto"        "R2WinBUGS"   
 [9] "RColorBrewer" "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/labeling/labeling_0.2.tar.gz'
Content type 'application/x-gzip' length 9998 bytes
downloaded 9998 bytes

 [1] "MASS"         "minqa"        "munsell"      "nlme"        
 [5] "plyr"         "proto"        "R2WinBUGS"    "RColorBrewer"
 [9] "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/MASS/MASS_7.3-29.tar.gz'
Content type 'application/x-gzip' length 485067 bytes (473 KB)
downloaded 473 KB

 [1] "minqa"        "munsell"      "nlme"         "plyr"        
 [5] "proto"        "R2WinBUGS"    "RColorBrewer" "RcppEigen"   
 [9] "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/minqa/minqa_1.2.3.tar.gz'
Content type 'application/x-gzip' length 53211 bytes (51 KB)
downloaded 51 KB

[1] "munsell"      "nlme"         "plyr"         "proto"       
[5] "R2WinBUGS"    "RColorBrewer" "RcppEigen"    "scales"      
[9] "stringr"     
trying URL 'http://cran.rstudio.com/src/contrib/munsell_0.4.2.tar.gz'
Content type 'application/x-gzip' length 91026 bytes (88 KB)
downloaded 88 KB

[1] "nlme"         "plyr"         "proto"        "R2WinBUGS"   
[5] "RColorBrewer" "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/nlme/nlme_3.1-111.tar.gz'
Content type 'application/x-gzip' length 753740 bytes (736 KB)
downloaded 736 KB

[1] "plyr"         "proto"        "R2WinBUGS"    "RColorBrewer"
[5] "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/plyr/plyr_1.8.1.tar.gz'
Content type 'application/x-gzip' length 393233 bytes (384 KB)
downloaded 384 KB

[1] "proto"        "R2WinBUGS"    "RColorBrewer" "RcppEigen"   
[5] "scales"       "stringr"     
trying URL 'http://cran.rstudio.com/src/contrib/proto_0.3-10.tar.gz'
Content type 'application/x-gzip' length 530758 bytes (518 KB)
downloaded 518 KB

[1] "R2WinBUGS"    "RColorBrewer" "RcppEigen"    "scales"      
[5] "stringr"     
trying URL 'http://cran.rstudio.com/src/contrib/R2WinBUGS_2.1-19.tar.gz'
Content type 'application/x-gzip' length 1140379 bytes (1.1 MB)
downloaded 1.1 MB

[1] "RColorBrewer" "RcppEigen"    "scales"       "stringr"     
trying URL 'http://cran.r-project.org/src/contrib/Archive/RColorBrewer/RColorBrewer_1.0-5.tar.gz'
Content type 'application/x-gzip' length 10656 bytes (10 KB)
downloaded 10 KB

[1] "RcppEigen" "scales"    "stringr"  
trying URL 'http://cran.r-project.org/src/contrib/Archive/RcppEigen/RcppEigen_0.3.2.0.2.tar.gz'
Content type 'application/x-gzip' length 1251504 bytes (1.2 MB)
downloaded 1.2 MB

[1] "scales"  "stringr"
trying URL 'http://cran.r-project.org/src/contrib/Archive/scales/scales_0.2.3.tar.gz'
Content type 'application/x-gzip' length 39429 bytes (38 KB)
downloaded 38 KB

[1] "stringr"
trying URL 'http://cran.r-project.org/src/contrib/Archive/stringr/stringr_0.6.2.tar.gz'
Content type 'application/x-gzip' length 20636 bytes (20 KB)
downloaded 20 KB

Switched to the 'SimsTest' computing environment. 48 packages are currently available. Packages installed in your site library ARE suppressed.
 To switch back to your previous environment type switchBack()
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\tomaug\AppData\Local\Temp\Rtmp6xNDsO/repo/src/contrib": The system cannot find the path specified
> 
> # Try loading a package
> library(plyr)
Error in library(plyr) : there is no package called ‘plyr’
> library(ggplot2)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘digest’
Error: package or namespace load failed for ‘ggplot2’
> library(knitr)
> warnings()
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\tomaug\AppData\Local\Temp\Rtmp6xNDsO/repo/src/contrib": The system cannot find the path specified
> 

So looks like I still have the same issues despite installing the most recent version of switchr.

For completeness here are a couple of other outputs you asked for earlier:

> switchTo("SimsTest")
Switched to the 'SimsTest' computing environment. 48 packages are currently available. Packages installed in your site library ARE suppressed.
 To switch back to your previous environment type switchBack()
> installed.packages()[,"Package"]
         abind           boot           coda      dichromat       evaluate 
       "abind"         "boot"         "coda"    "dichromat"     "evaluate" 
       formatR        ggplot2         gtable          highr          knitr 
     "formatR"      "ggplot2"       "gtable"        "highr"        "knitr" 
      labeling        munsell          proto         R2jags      R2WinBUGS 
    "labeling"      "munsell"        "proto"       "R2jags"    "R2WinBUGS" 
  RColorBrewer       reshape2         scales        stringr           base 
"RColorBrewer"     "reshape2"       "scales"      "stringr"         "base" 
          boot          class        cluster      codetools       compiler 
        "boot"        "class"      "cluster"    "codetools"     "compiler" 
      datasets        foreign       graphics      grDevices           grid 
    "datasets"      "foreign"     "graphics"    "grDevices"         "grid" 
    KernSmooth        lattice           MASS         Matrix        methods 
  "KernSmooth"      "lattice"         "MASS"       "Matrix"      "methods" 
          mgcv           nlme           nnet       parallel          rpart 
        "mgcv"         "nlme"         "nnet"     "parallel"        "rpart" 
       spatial        splines          stats         stats4       survival 
     "spatial"      "splines"        "stats"       "stats4"     "survival" 
         tcltk          tools   translations          utils 
       "tcltk"        "tools" "translations"        "utils" 
> list.files("~/.switchr/SimsTest")
 [1] "abind"        "boot"         "coda"         "dichromat"   
 [5] "evaluate"     "formatR"      "ggplot2"      "gtable"      
 [9] "highr"        "knitr"        "labeling"     "lib_info"    
[13] "munsell"      "proto"        "R2jags"       "R2WinBUGS"   
[17] "RColorBrewer" "reshape2"     "scales"       "stringr"     
gmbecker commented 9 years ago

@AugustT it's gratifying to hear that scientists like the concept of switchr and what it's trying to do. Thanks for bringing it to your group. Now on to your output.

I think what may have happened is that the library already existed from a previous failed attempt, so no new packages were installed from the seed.. I have fixed this so it should avoid the expensive seed repository construction in cases like this where it isn't going to use them anyway, and have added a message indicating that the seed isn't being used because of an existing library.

Can you grab the latest version of switchr (0.5.16) and try again (I've removed the print command so the output will be less annoyingly verbose, though still not small) after removing the library via

library(switchr)
removeLib("SimsTest")

Thanks ~G