问题
I am trying to install a package from Github, but it's showing me always the same error:
> install_github("jfpalomeque/Momocs")
Installing github repo Momocs/master from jfpalomeque
Downloading master.zip from https://github.com/jfpalomeque/Momocs/archive/master.zip
Installing package from C:\DOCUME~1\Ged\CONFIG~1\Temp\RtmpE15W58/master.zip
Installing Momocs
"C:/ARCHIV~1/R/R-31~1.0/bin/i386/R" --vanilla CMD INSTALL "C:\Documents and \
Settings\Ged\Configuración \
local\Temp\RtmpE15W58\devtools5a86536733\Momocs-master" \
--library="C:/Archivos de programa/R/R-3.1.0/library" --install-tests
Warning: invalid package 'C:\Documents and Settings\Ged\Configuración local\Temp\RtmpE15W58\devtools5a86536733\Momocs-master'
Error: ERROR: no packages specified
Error: Command failed (1)
My sesion:
R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
回答1:
Please make sure you have the newest version of the devtools package. This is 1.5 at the moment.To do so run
install.packages("devtools")
Then you have 3 options:
1:) You can try using different parameter alternatives in the devtools package.
install_github("Momocs",username="jfpalomeque")
2:) Another way is trying to download the zip file and install it with the normal install.packages() function in R with:
install.packages(file_name_and_path, repos = NULL, type="source")
3:) You can also just install it from cran with
install.packages("Momocs")
as it is the same version and the same author as the github package.
Regards
回答2:
You may want to try
devtools::install_github("vbonhomme/Momocs") instead. As stated before, you need devtools to make it work.
Also, Momocs 1.0.0 is on CRAN so you can simply: install.packages("Momocs").
Have a look to the vignette for a nice entry point into the package. And I'm here to help if required.
回答3:
Install the latest R packages from github repository.
Steps to install R packages if you don't have internet access on your server/machine.
- First you need to install R packages devtools and git2r (git2r not mandatory, it depends on the package you would like to install )
- Download the master zip file from git package location
- Unzip the package on a windows path
- Create a source: source <- devtools:::source_pkg("windows path/master directory name")
- install(source)
Hope it helps.
来源:https://stackoverflow.com/questions/24914510/install-r-package-from-github