2016-07-20 11 views
2

Ich habe ein persönliches R-Paket mit Hilfsfunktionen, die ich in verschiedenen Projekten verwende. Ich würde jedoch gerne ein Projekt mit einer bestimmten Version des Projekts arbeiten lassen und dann Code hinzufügen. Ich verstehe, dass ich das mit Zweigen machen könnte, aber ich würde es lieber mit Commit-Tags machen.Wie installiere ich einen bestimmten getaggten Commit eines R-Pakets

Mit Blick auf die Dokumentation für devtools::install_git scheint es, dass wenn ich ein Commit taggen sollte, ich in der Lage sein sollte, diese bestimmte Commit zu installieren, aber das funktioniert nicht für mich.

Dies ist ein Bild zeigt, dass ich ein "v0.0.1" getaggt commit enter image description here

Aber versucht es zu installieren, gibt mir diese:

devtools::install_git(url = 'http://<username>@<company stash url>/scm/preamp.git', branch = 'v0.0.1') 

# > Downloading git repo http://<username>@<company stash url>/scm/preamp.git 
# > Error in .local(object, ...) : 'v0.0.1' did not match any branch 

Meine R Sitzungsinformationen:

> sessionInfo() 
R version 3.2.3 (2015-12-10) 
Platform: x86_64-apple-darwin13.4.0 (64-bit) 
Running under: OS X 10.11.1 (El Capitan) 

locale: 
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 

attached base packages: 
[1] parallel splines stats  graphics grDevices utils  datasets methods base  

other attached packages: 
[1] tidyr_0.5.1     lazyeval_0.2.0    assertthat_0.1    
[4] beepr_1.2     preamp_0.1     stringr_1.0.0    
[7] readr_0.2.2     lubridate_1.5.6    xgboost_0.4-3    
[10] magrittr_1.5    dplyr_0.5.0     jsonlite_1.0    
[13] httr_1.2.1     rvdata_0.1.0    RODBC_1.3-12    
[19] XML_3.98-1.4    reshape2_1.4.1    ggplot2_2.1.0    
[22] DT_0.1      infotheo_1.2.0    RMySQL_0.10.9    
[25] ROCR_1.0-7     gplots_2.17.0    gtools_3.5.0    
[28] gbm_2.1.1     lattice_0.20-33    survival_2.38-3    
[31] plyr_1.8.4     sqldf_0.4-10    RSQLite_1.0.0    
[34] DBI_0.4-1     gsubfn_0.6-6    proto_0.3-10    
[37] coreFunctions_0.1.0   devtools_1.10.0    

loaded via a namespace (and not attached): 
[1] tcltk_3.2.3  colorspace_1.2-6 htmltools_0.3.5 chron_2.3-47  withr_1.0.1  
[6] audio_0.1-5  munsell_0.4.3  gtable_0.2.0  caTools_1.17.1  htmlwidgets_0.6 
[11] memoise_1.0.0  curl_0.9.7   Rcpp_0.12.5  KernSmooth_2.23-15 scales_0.4.0  
[16] gdata_2.17.0  digest_0.6.9  stringi_1.1.1  grid_3.2.3   tools_3.2.3  
[21] bitops_1.0-6  tibble_1.1   Matrix_1.2-3  data.table_1.9.6 R6_2.1.2   
[26] git2r_0.13.1 
+0

noch gefragt, ob jemand irgendwelche Erkenntnisse hier hat? – Moderat

Antwort

0

Von diesem Screenshot aus sieht es so aus, als wäre Ihr Paket auf GitHub? Können Sie install_github verwenden, um eine bestimmte Version eines Pakets zu installieren? In dieser Funktion geben Sie einen commit/tag/Zweig mit ref, etwa so:

> library(devtools) 
> install_github("hadley/lubridate", ref = "v1.6.0") 
Using GitHub PAT from envvar GITHUB_PAT 
Downloading GitHub repo hadley/[email protected] 
from URL https://api.github.com/repos/hadley/lubridate/zipball/v1.6.0 
Installing lubridate 
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \ 
    '/private/var/folders/0w/prb4hnss2gn1p7y34qb2stw00000gp/T/RtmpZcDif6/devtools3b442dfebb82/hadley-lubridate-d986d4b' \ 
    --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library' --install-tests 

* installing *source* package ‘lubridate’ ... 
** libs 
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c datetime.c -o datetime.o 
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c period.c -o period.o 
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c tparse.c -o tparse.o 
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c utils.c -o utils.o 
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o lubridate.so datetime.o period.o tparse.o utils.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation 
installing to /Library/Frameworks/R.framework/Versions/3.3/Resources/library/lubridate/libs 
** R 
** data 
*** moving datasets to lazyload DB 
** inst 
** tests 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (lubridate)