Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Installing dependencies fails on Windows (which occurs with dev version) #1191
Installing dependencies fails on my local Windows environment with dev version of
devtools::install_github("sinhrks/ggfortify", dependencies = TRUE, force = TRUE) #> Downloading GitHub repo sinhrks/ggfortify@master #> from URL https://api.github.com/repos/sinhrks/ggfortify/zipball/master #> Installing ggfortify #> trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/dlm_1.1-4.zip' #> Content type 'application/zip' length 550878 bytes (537 KB) #> downloaded 537 KB #> #> Installing dlm #> "C:/PROGRA~1/R/R-33~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \ #> "C:/Users/user1/AppData/Local/Temp/RtmpCcjLkl/devtools251477d67687/dlm" --library="C:/Users/user1/Documents/R/win-library/3.3" \ #> --install-tests #> #> * installing *binary* package 'dlm' ... #> cp: unknown option -- ) #> Try '/usr/bin/cp --help' for more information. #> Warning: running command 'cp -R . "C:/Users/user1/Documents/R/win-library/3.3/dlm" || ( internal cd - .| (cd "C:/Users/user1/Documents/R/win-library/3.3/dlm" && internal -xf -))' had status 1 #> ERROR: installing binary package failed #> * removing 'C:/Users/user1/Documents/R/win-library/3.3/dlm' #> Error: Command failed (1)
I've dived into the R source code. This code
is from around here.
res <- system(paste("cp -R .", shQuote(instdir), "|| (", TAR, "cd - .| (cd", shQuote(instdir), "&&", TAR, "-xf -))" ))
But it says this
The correct way of installing binary packages on Windows platform seems to be using ZIP archive without decompressing. I suspect the problem is that
Could you consider adding condition branch for Windows?
sessionInfo() #> R version 3.3.0 (2016-05-03) #> Platform: x86_64-w64-mingw32/x64 (64-bit) #> Running under: Windows >= 8 x64 (build 9200) #> #> locale: #>  LC_COLLATE=Japanese_Japan.932 LC_CTYPE=Japanese_Japan.932 LC_MONETARY=Japanese_Japan.932 LC_NUMERIC=C #>  LC_TIME=Japanese_Japan.932 #> #> attached base packages: #>  stats graphics grDevices utils datasets methods base #> #> loaded via a namespace (and not attached): #>  httr_1.1.0 R6_2.1.2 tools_3.3.0 withr_1.0.1 curl_0.9.7 memoise_1.0.0 #>  git2r_0.15.0 digest_0.6.9 devtools_184.108.40.20600
I feel like this is really a bug / shortcoming in R, in that you cannot install binary package on Windows once it is extracted.
dest <- download.packages("zoo", tempdir(), type = "win.binary")[,2] unzip(dest, exdir = tempdir()) install.packages(file.path(tempdir(), "zoo"), repos = NULL, type = 'source') #> Installing package into 'C:/library' #> (as 'lib' is unspecified) #> Warning in install.packages : #> running command '"C:/PROGRA~1/R/R-33~1.0/bin/x64/R" CMD INSTALL -l "C:\library" "C:/pkg/temp/RtmpU7RZbU/zoo"' had status 1 #> Warning in install.packages : #> installation of package 'C:/pkg/temp/RtmpU7RZbU/zoo' had non-zero exit status
Nonetheless #1192 fixes your example and should fix the issue.
Im trying to install SparkR on 64 bit windows with R3.3.2. Facing the same error while trying to install SparkR through devtools from command line as:
%SPARK_HOME%\R\lib\SparkR>R -e "devtools::install ('.')"
Warning: running command 'cp -R . "C:/Users/HP/Documents/R/win-library/3.3/Spark
I read the previous posts where this seems to be fixed. Which release is this available? How can I continue with my installation?