Vectorization of the install_github function from the devtools package to R

I am using a package devtoolsto install R packages from GitHub. In the function guide there is a proposal for a parameter repo, which function is vectorized by this parameter

This function is vectorized by repo, so you can install multiple packages in one command.

I created 5 packages and I distribute them in one github repository in 5 different subdirectories. When I use this command to set all 5 of them into one function call

> if (!require(devtools)) {
+    install.packages("devtools")
+    require(devtools)
+ }
> install_github(paste0("mi2-warsaw/RTCGA.data/", 
+                   subdir = paste0("RTCGA.", 
+                                   c("clinical",
+                                     "rnaseq",
+                                     "mutations",
+                                     "cnv",
+                                     "PANCAN12")
+                                  )
+                )
+ )
Downloading github repo mi2-warsaw/RTCGA.data@master
Installing RTCGA.clinical
"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" --no-site-file --no-environ  \
  --no-save --no-restore CMD INSTALL  \
  "C:/Users/Marcin/AppData/Local/Temp/RtmpeSTVOR/devtoolse483660419b/mi2-warsaw-RTCGA.data-f38f079/RTCGA.clinical"  \
  --library="C:/Users/Marcin/Documents/R/win-library/3.2"  \
  --install-tests 

* installing *source* package 'RTCGA.clinical' ...
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (RTCGA.clinical)
Downloading github repo mi2-warsaw/RTCGA.data@master
Installing RTCGA.rnaseq
"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" --no-site-file --no-environ  \
  --no-save --no-restore CMD INSTALL  \
  "C:/Users/Marcin/AppData/Local/Temp/RtmpeSTVOR/devtoolse4839392db6/mi2-warsaw-RTCGA.data-3c044a0/RTCGA.rnaseq"  \
  --library="C:/Users/Marcin/Documents/R/win-library/3.2"  \
  --install-tests 

* installing *source* package 'RTCGA.rnaseq' ...
** R
** data
*** moving datasets to lazyload DB

It seems that for each installation of one package the entire repository is loaded. Therefore, as a result, the entire repository is downloaded 5 times ... Is there a way to download the repository once and install 5 packages then - if possible - in one function call, similar to the one I use?

+4

Source: https://habr.com/ru/post/1598577/


All Articles