Getting error while installing R packages? - r

It has been awhile since i updated my packages. This morning when i tried to used update.packages(ask = F), it download the packages and tried to run the update but has spit out a number of warnings. see some glimpses here
> update.packages(ask = FALSE)
There are binary versions available but the source versions are later:
binary source needs_compilation
backports 1.1.7 1.1.9 TRUE
maptools 1.0-1 1.0-2 TRUE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/backports_1.1.7.zip'
Content type 'application/zip' length 81641 bytes (79 KB)
downloaded 79 KB
package ‘backports’ successfully unpacked and MD5 sums checked
package ‘dplyr’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘dplyr’
Warning: restored ‘dplyr’
Not sure what happened but when i am trying to load the package i am getting message such as the one attached as picture. Anyway forward please as it seems i have lost everything.

Related

How to compile an R package from source code in Windows 10

I need to compile an existing R package whose most recent version exists only as source code (it is on the CRAN website). I am running Windows 10. With Windows, install.packages just installs the older, binary version, which results in an error message and failure to install the package that depends on the one in question because the latter is not the recent version. I installed R Tools to my computer. The Installation and Administration manual for my version (3.6.3) refers to an Option “install.packages.compile.from.source.code”, but I don’t know to what command this option applies. If I run it in an Options() command it returns NULL. Moreover, the older, obsolete, binary version of the package was installed by install.packages. I don’t know if it is interfering with the process or how to get rid of it.
I can find guidance for ordinary install.packages and guidance for compilation oriented to package developers (which I’m not) in Stack Overflow, but nothing that applies to my situation (installing a package having an existing binary whose newest version exists only in source code, given that the binary version is already installed).
Any help you can offer would be greatly appreciated.
Thank you.
Sincerely,
Ward Kingkade
wwardkingkade#gmail.com
Illustration of basic issue (log):
> utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘ipred’, ‘recipes’
There are binary versions available but the source versions are later:
binary source needs_compilation
ipred 0.9-11 0.9-12 TRUE
recipes 0.1.16 0.1.17 FALSE
caret 6.0-86 6.0-90 TRUE
Binaries will be installed
trying URL 'https://mirrors.nics.utk.edu/cran/bin/windows/contrib/3.6/ipred_0.9-11.zip'
Content type 'application/zip' length 401183 bytes (391 KB)
downloaded 391 KB
trying URL 'https://mirrors.nics.utk.edu/cran/bin/windows/contrib/3.6/caret_6.0-86.zip'
Content type 'application/zip' length 6258933 bytes (6.0 MB)
downloaded 6.0 MB
package ‘ipred’ successfully unpacked and MD5 sums checked
package ‘caret’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Ward_\AppData\Local\Temp\RtmpghJ2SG\downloaded_packages
installing the source package ‘recipes’
trying URL 'https://mirrors.nics.utk.edu/cran/src/contrib/recipes_0.1.17.tar.gz'
Content type 'application/x-gzip' length 681531 bytes (665 KB)
downloaded 665 KB
* installing *source* package 'recipes' ...
** package 'recipes' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'ipred' 0.9-11 is being loaded, but >= 0.9.12 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'recipes'
* removing 'C:/Users/Ward_/Documents/R/win-library/3.6/recipes'
The downloaded source packages are in
‘C:\Users\Ward_\AppData\Local\Temp\RtmpghJ2SG\downloaded_packages’
Warning message:
In install.packages(lib = .libPaths()[1L], dependencies = NA, type = type) :
installation of package ‘recipes’ had non-zero exit status

install.packages(...) fails on Windows 10

I am trying to install the dplyr package from Visual Studio 2017. It has a dependency on pillar.
When I perform an install from the command line, I get:
> install.packages('pillar')
Installing package into ‘C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
pillar 1.2.1 1.2.2 FALSE
installing the source package ‘pillar’
trying URL 'http://cran.r-project.org/src/contrib/pillar_1.2.2.tar.gz'
Content type 'application/x-gzip' length 64185 bytes (62 KB)
downloaded 62 KB
* installing *source* package 'pillar' ...
** package 'pillar' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Jirtme Verstrynge/Documents/R/win-library/3.3/pillar/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'pillar'
* removing 'C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.3/pillar'
There is a bogus conversion of Jérôme Verstrynge into Jirtme Verstrynge.
How can I work around this?
More information
When I perform Get-WinSystemLocale from Windows 10 PowerShell, I get:
LCID Name DisplayName
---- ---- -----------
2057 en-GB English (United Kingdom)
Sys.getlocale() returns:
[1] "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"
Workaround
I have uninstalled Microsoft R client and reinstalled it from here. The client is now on version 3.4.3.0.
The issue has disappeared for the package pillar, but it is coming back with a package called dendextend while trying to install.packages('seriation').
The error is:
> install.packages('seriation')
Installing package into ‘C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘dendextend’
There is a binary version available but the source version is later:
binary source needs_compilation
dendextend 1.7.0 1.8.0 FALSE
trying URL 'http://cran.r-project.org/bin/windows/contrib/3.4/seriation_1.2-3.zip'
Content type 'application/zip' length 1015954 bytes (992 KB)
downloaded 992 KB
package ‘seriation’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Temp\Rtmpi2lOd8\downloaded_packages
installing the source package ‘dendextend’
trying URL 'http://cran.r-project.org/src/contrib/dendextend_1.8.0.tar.gz'
Content type 'application/x-gzip' length 1758392 bytes (1.7 MB)
downloaded 1.7 MB
* installing *source* package 'dendextend' ...
** package 'dendextend' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Jirtme Verstrynge/Documents/R/win-library/3.4/dendextend/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'dendextend'
* removing 'C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.4/dendextend'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Temp\Rtmpi2lOd8\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/MIE74D~1/RCLIEN~1/R_SERVER/bin/x64/R" CMD INSTALL -l "C:\Users\Jérôme Verstrynge\Documents\R\win-library\3.4" C:\Temp\Rtmpi2lOd8/downloaded_packages/dendextend_1.8.0.tar.gz' had status 1
2: In utils::install.packages(...) :
installation of package ‘dendextend’ had non-zero exit status
>
It seems there is an issue in utils::install.packages(...)
Issue solved
Apparently, on top of re-installing Microsoft R Client, the remaining issue was related to missing binary packages not available on CRAN repositories yet.
I doubt this has anything to do with the pillar package, but perhaps with the fact that this package is installed from source (unlike the default which is to install from binary). This problem will eventually resolve itself as the binary version of pillar 1.2.2 becomes available on your CRAN mirror (it's already there on CRAN and on https://cloud.r-project.org/web/packages/pillar/index.html).
What's the value of getOption("repos") on your system?
The mis-encoding of non-ASCII characters in this particular scenario feels like a problem which is best avoided by choosing an ASCII-only and space-free directory name for your home (e.g. C:\Users\jverstry instead of your current setting). To rule out a problem with Visual Studio, you could try installing the package from RGui or from the R terminal, please double-check that the installation path for the package is the same.

Persistence when running update.packages in R

If I open up an R console and send the command
update.packages(repos = "https://cran.cnr.Berkeley.edu/",ask=FALSE,checkBuilt=TRUE)`
It starts updating a small collection of packages, a somewhat representative output might include
Warning: package 'mgcv' in library 'C:/Program Files/R/R-3.4.2/library' will not be updated
There is a binary version available but the source version is later:
binary source needs_compilation
rlang 0.1.2 0.1.4 TRUE
Binaries will be installed
trying URL 'https://cran.cnr.Berkeley.edu/bin/windows/contrib/3.4/rlang_0.1.2.zip'
Content type 'application/zip' length 466520 bytes (455 KB)
downloaded 455 KB
package 'rlang' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\me\AppData\Local\Temp\RtmpYFaFCR\downloaded_packages
update.packages(repos = "https://cran.cnr.Berkeley.edu/",ask=FALSE,checkBuilt=TRUE)
Warning: package 'mgcv' in library 'C:/Program Files/R/R-3.4.2/library' will not be updated
There is a binary version available but the source version is later:
binary source needs_compilation
rlang 0.1.2 0.1.4 TRUE
Binaries will be installed
trying URL 'https://cran.cnr.Berkeley.edu/bin/windows/contrib/3.4/rlang_0.1.2.zip'
Content type 'application/zip' length 466520 bytes (455 KB)
downloaded 455 KB
package 'rlang' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\me\AppData\Local\Temp\RtmpYFaFCR\downloaded_packages
Unfortunately, if I turn around and run this again, I get the same report. This strikes me as not quite right, as these packages (with the exception of the ones explicitly tagged as "Will not be updated") should have been updated. Why are they still out of date?
The example above is small because I'm starting from a relatively new install, but as the months go by, this list will get longer and longer and it bogs down my script.
Hopefully this will be easily reproducible.

Persistent problems installing the car package in R

I'm having problems installing the package car in R.
There are previous posts on the topic, including this one and this other one.
I have followed the suggestions I've come across so far without success. I am using R Version 3.2.2. and RStudio.
This is the message I get:
install.packages("car")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/car_2.1-3.zip'
Content type 'application/zip' length 1447213 bytes (1.4 MB)
downloaded 1.4 MB
package ‘car’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
If I check I get,
?car
No documentation for ‘car’ in specified packages and libraries:
you could try ‘??car’
I tried installing it from R with Install packages from local zip drives, and looking for the zip in C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages, but this is the result:
library(car)
Error in library.dynam(lib, package, package.lib) :
DLL ‘SparseM’ not found: maybe not installed for this architecture?
In addition: Warning message:
package ‘car’ was built under R version 3.2.5
Error: package or namespace load failed for ‘car’
I did try installing SparseM even before posting the OP without success:
> install.packages("SparseM")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/SparseM_1.7.zip'
Content type 'application/zip' length 795531 bytes (776 KB)
downloaded 776 KB
package ‘SparseM’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
> ?SparseM
No documentation for ‘SparseM’ in specified packages and libraries:
you could try ‘??SparseM’
Follow up:
After a comment regarding R version 3.2.3 I thought it would be an easy fix to just download this version, install, and erase 3.2.2. The problem then is that RStudio did not seem to work. I un-installed and re-installed R-studio, and now I get this when opening R studio:
Without knowing what version of the car package you're using, it's hard to know exactly what the source of the problem is. It seems likely, however, that you haven't installed the proper version of the pbkrtest, on which the Rcmdr package depends.
Is there a compelling reason not to upgrade everything to their current versions, including R, all packages, and RStudio?
Best,
John

Can't Load R DESeq2 Library, Installed All Missing Packages and Still Have Problems

I'm running into some bad problems installing and using the DESeq2 package for R.
I freshly installed R 3.3.1 and Rstudio 0.99.903 on Win7.
I tried installing DESeq2 using:
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
but it run into a lot of errors (some missing packages for some dependency packages etc...) Then I tried installing all the missing packages manually by downloading from CREN and installing the missing packages from .zip files.
Then I tried running few commands and I hope the information from them will help finding the cause of all the errors:
First the biocLite (the installer of all the related packages, on the previous installation of the DESeq2 package everything was smooth... but it was on Linux)
> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.3 (BiocInstaller 1.22.3), ?biocLite for help
> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'survival'
Update all/some/none? [a/s/n]:
a
There is a binary version available but the source version is later:
binary source needs_compilation
GenomicRanges 1.24.2 1.24.3 TRUE
Binaries will be installed
Packages which are only available in source form, and may need compilation of C/C++/Fortran:
‘lattice’ ‘mgcv’ ‘survival’
These will not be installed
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/GenomicRanges_1.24.2.zip'
Content type 'application/zip' length 2723057 bytes (2.6 MB)
downloaded 2.6 MB
package ‘GenomicRanges’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'survival'
Update all/some/none? [a/s/n]:
n
> biocLite("DESeq2")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Installing package(s) ‘DESeq2’
also installing the dependency ‘Rcpp’
There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 0.12.4.5 0.12.7 TRUE
Binaries will be installed
trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/DESeq2_1.12.4.zip'
Content type 'application/zip' length 3937521 bytes (3.8 MB)
downloaded 3.8 MB
package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘DESeq2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'Rcpp', 'survival'
Update all/some/none? [a/s/n]:
a
There are binary versions available but the source versions are later:
binary source needs_compilation
GenomicRanges 1.24.2 1.24.3 TRUE
Rcpp 0.12.4.5 0.12.7 TRUE
Binaries will be installed
Packages which are only available in source form, and may need compilation of C/C++/Fortran:
‘lattice’ ‘mgcv’ ‘survival’
These will not be installed
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/GenomicRanges_1.24.2.zip'
Content type 'application/zip' length 2723057 bytes (2.6 MB)
downloaded 2.6 MB
trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB
package ‘GenomicRanges’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
Then trying to install the DESeq2 package with biocLite (looks like everything is good)
> biocLite("DESeq2")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.3 (BiocInstaller 1.22.3), R 3.3.1 (2016-06-21).
Installing package(s) ‘DESeq2’
also installing the dependency ‘Rcpp’
There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 0.12.4.5 0.12.7 TRUE
Binaries will be installed
trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/DESeq2_1.12.4.zip'
Content type 'application/zip' length 3937521 bytes (3.8 MB)
downloaded 3.8 MB
package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘DESeq2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
Old packages: 'GenomicRanges', 'lattice', 'mgcv', 'Rcpp', 'survival'
Update all/some/none? [a/s/n]:
a
There are binary versions available but the source versions are later:
binary source needs_compilation
GenomicRanges 1.24.2 1.24.3 TRUE
Rcpp 0.12.4.5 0.12.7 TRUE
Binaries will be installed
Packages which are only available in source form, and may need compilation of C/C++/Fortran:
‘lattice’ ‘mgcv’ ‘survival’
These will not be installed
trying URL 'https://bioconductor.org/packages/3.3/bioc/bin/windows/contrib/3.3/GenomicRanges_1.24.2.zip'
Content type 'application/zip' length 2723057 bytes (2.6 MB)
downloaded 2.6 MB
trying URL 'https://bioconductor.org/packages/3.3/extra/bin/windows/contrib/3.3/Rcpp_0.12.4.5.zip'
Content type 'application/zip' length 6458713 bytes (6.2 MB)
downloaded 6.2 MB
package ‘GenomicRanges’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages
Now loading the DESeq2 library (Errors...):
> library("DESeq2")
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: ‘BiocGenerics’
The following objects are masked from ‘package:parallel’:
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap,
parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from ‘package:stats’:
IQR, mad, xtabs
The following objects are masked from ‘package:base’:
anyDuplicated, append, as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match,
mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rownames,
sapply, setdiff, sort, table, tapply, union, unique, unsplit
Attaching package: ‘S4Vectors’
The following objects are masked from ‘package:base’:
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor
Vignettes contain introductory material; view with 'browseVignettes()'. To cite
Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘data.table’
Error: package or namespace load failed for ‘DESeq2’
Tried installing the missing package:
> install.packages('data.table', dependencies = TRUE)
also installing the dependencies ‘minqa’, ‘nloptr’, ‘RcppEigen’, ‘lme4’, ‘SparseM’, ‘pbkrtest’, ‘quantreg’, ‘mime’, ‘bit’, ‘gtools’, ‘car’, ‘markdown’, ‘yaml’, ‘bdsmatrix’, ‘sandwich’, ‘lmtest’, ‘chron’, ‘testthat’, ‘hexbin’, ‘fastmatch’, ‘xts’, ‘bit64’, ‘gdata’, ‘caret’, ‘knitr’, ‘curl’, ‘zoo’, ‘plm’
Packages which are only available in source form, and may need compilation of C/C++/Fortran:
‘minqa’ ‘nloptr’ ‘RcppEigen’ ‘lme4’ ‘SparseM’ ‘quantreg’ ‘mime’ ‘bit’ ‘gtools’ ‘markdown’
‘yaml’ ‘bdsmatrix’ ‘lmtest’ ‘chron’ ‘testthat’ ‘hexbin’ ‘fastmatch’ ‘xts’ ‘bit64’ ‘caret’
‘curl’ ‘zoo’ ‘data.table’
These will not be installed
installing the source packages ‘pbkrtest’, ‘car’, ‘sandwich’, ‘gdata’, ‘knitr’, ‘plm’
trying URL 'https://cran.rstudio.com/src/contrib/pbkrtest_0.4-6.tar.gz'
Content type 'application/x-gzip' length 165269 bytes (161 KB)
downloaded 161 KB
trying URL 'https://cran.rstudio.com/src/contrib/car_2.1-3.tar.gz'
Content type 'application/x-gzip' length 622922 bytes (608 KB)
downloaded 608 KB
trying URL 'https://cran.rstudio.com/src/contrib/sandwich_2.3-4.tar.gz'
Content type 'application/x-gzip' length 466729 bytes (455 KB)
downloaded 455 KB
trying URL 'https://cran.rstudio.com/src/contrib/gdata_2.17.0.tar.gz'
Content type 'application/x-gzip' length 1041264 bytes (1016 KB)
downloaded 1016 KB
trying URL 'https://cran.rstudio.com/src/contrib/knitr_1.14.tar.gz'
Content type 'application/x-gzip' length 1017858 bytes (994 KB)
downloaded 994 KB
trying URL 'https://cran.rstudio.com/src/contrib/plm_1.5-12.tar.gz'
Content type 'application/x-gzip' length 1246790 bytes (1.2 MB)
downloaded 1.2 MB
ERROR: dependency 'lme4' is not available for package 'pbkrtest'
* removing 'C:/Program Files/R/R-3.3.1/library/pbkrtest'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/pbkrtest_0.4-6.tar.gz' had status 1
Warning in install.packages :
installation of package ‘pbkrtest’ had non-zero exit status
ERROR: dependency 'zoo' is not available for package 'sandwich'
* removing 'C:/Program Files/R/R-3.3.1/library/sandwich'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/sandwich_2.3-4.tar.gz' had status 1
Warning in install.packages :
installation of package ‘sandwich’ had non-zero exit status
ERROR: dependency 'gtools' is not available for package 'gdata'
* removing 'C:/Program Files/R/R-3.3.1/library/gdata'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/gdata_2.17.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘gdata’ had non-zero exit status
ERROR: dependencies 'markdown', 'yaml' are not available for package 'knitr'
* removing 'C:/Program Files/R/R-3.3.1/library/knitr'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/knitr_1.14.tar.gz' had status 1
Warning in install.packages :
installation of package ‘knitr’ had non-zero exit status
ERROR: dependencies 'pbkrtest', 'quantreg' are not available for package 'car'
* removing 'C:/Program Files/R/R-3.3.1/library/car'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/car_2.1-3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
ERROR: dependencies 'bdsmatrix', 'zoo', 'sandwich', 'car', 'lmtest' are not available for package 'plm'
* removing 'C:/Program Files/R/R-3.3.1/library/plm'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.1\library" C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC/downloaded_packages/plm_1.5-12.tar.gz' had status 1
Warning in install.packages :
installation of package ‘plm’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\user\AppData\Local\Temp\Rtmp0wyDJC\downloaded_packages’
And sessioninfo:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Hebrew_Israel.1255 LC_CTYPE=Hebrew_Israel.1255 LC_MONETARY=Hebrew_Israel.1255
[4] LC_NUMERIC=C LC_TIME=Hebrew_Israel.1255
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] SummarizedExperiment_1.2.3 Biobase_2.32.0 GenomicRanges_1.24.2
[4] GenomeInfoDb_1.8.7 IRanges_2.6.1 S4Vectors_0.10.3
[7] BiocGenerics_0.18.0 BiocInstaller_1.22.3
loaded via a namespace (and not attached):
[1] Rcpp_0.12.4.5 Formula_1.2-1 cluster_2.0.4 XVector_0.12.1 splines_3.3.1
[6] zlibbioc_1.18.0 munsell_0.4.3 BiocParallel_1.6.6 colorspace_1.2-6 lattice_0.20-33
[11] plyr_1.8.4 tools_3.3.1 nnet_7.3-12 grid_3.3.1 gtable_0.2.0
[16] latticeExtra_0.6-28 survival_2.39-4 Matrix_1.2-7.1 gridExtra_2.2.1 RColorBrewer_1.1-2
[21] ggplot2_2.1.0 acepack_1.3-3.3 rpart_4.1-10 scales_0.4.0 foreign_0.8-66
>
Because I already installed >10 packages by hand I assume the solution is not to keep installing the missing packages because those packages will have more missing packages and more and more and I won't get out of this loop.
I also tried something I found on google:
remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)
but the installation had errors too, I can write them here if needed.
I hope you can see something I can't see and help me solving this issue.
Thanks.
It seems that lots of packages, most importantly data.table and lme4, were not properly compiled.
I would suggest to install data.table, lme4 and all of the packages denoted in the 2 statements that said Packages which are only available in source form, and may need compilation of C/C++/Fortran: with pacman then re-run the Bioconductor installation of your target package.
install.packages("pacman")
pacman::p_load(data.table, lme4, lattice, mgcv, survival, zoo, markdown,... <etc>)
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
I just confirmed this works on Windows.
Also note, however, that the error you got has been associated in the past with mirror outages. So if you still get this error try changing your CRAN mirror. install.packages('<package_name>', repo='http://nbcgib.uesc.br/mirrors/cran/')
Also make sure that you have RTools.exe installed and working.
biocLite(), install.packages() (and the devtools equivalent?) check that immediate dependencies are installed, but not that the dependencies of those, etc are installed. Likely what happened is that you managed to install a dependency, but then corrupted your installation by removing one of it's dependencies (manually via remove.packages(), or changing .libPaths(), or...? it would be good to hear any speculation you have of how this might have happened).
One solution is to find all available packages
avail = available.packages(repos=BiocInstaller::biocinstallRepos())
then all dependencies
deps0 = tools::package_depenencies("DESeq2", avail)
deps = unique(unlist(deps0, use.names=FALSE))
and unsatisfied dependencies
need = setdiff(deps, rownames(installed.packages()))
I'd take a look at need, to see if there are any insights to be had, so that you can correct the root problem rather than having to do this procedure with other packages. And finally, install the problem packages, perhaps also DESeq2.
biocLite(c(need, "DESeq2"))
In the Bioconductor realm, I would then check that package versions are consistent with the version of Bioconductor in use
BiocInstaller::biocValid()
and would ask more Bioconductor-related questions on the Bioconductor support site
This is the same answer I wrote in a comment to Hack-R I just wanted to post a separate answer:
What I did was - uninstalled everything (RTools then RStudio thenR and also I deleted the R directory because it still had all the previous libraries) I did this in order to eliminate any chance that something was corrupt.
(I highlighted the important points):
Then I reinstalled R then Rstudio then RTools. I again tried the installation with biocLite but was met with errors of missing packages (or the installation was ok and the when I tried loading the DESeq2 library I was met with missing packages errors) so I changed the CRAN mirror in RStudio. I tried the installation with biocLite again and was met with missing packages again (or the installation was ok and the when I tried loading the DESeq2 library I was met with missing packages errors, I don't remember) BUT!!! now when I tried installing the missing packages manually (with install.packages("missingPackage")) they did install correctly. Finally After 3-4 manual installations of missing packages everything worked.
Sorry for the mediocre English.
I hope I helped somebody.
Try the following
if(! "pacman" %in% installed.packages()) install.packages("pacman")
pacman::p_load(char = packages)
pacman::p_load(DESeq2)
install.packages("DESeq2")
library("DESeq2")

Resources