Error when installing "Diffbind" package in R - r

I was trying to install DiffBind package in R, but it reports to me some errors. Could anyone explain to me how to fix errors and installing properly it?
That's the message:
BiocManager::install("DiffBind")
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details
replacement repositories:
CRAN: https://cloud.r-project.org
Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.3 (2022-03-10)
Installing package(s) 'DiffBind'
si installano anche le dipendenze ‘RcppEigen’, ‘RcppNumerical’, ‘apeglm’
apertura URL 'https://cloud.r-project.org/src/contrib/RcppEigen_0.3.3.9.2.tar.gz'
Content type 'application/x-gzip' length 1476004 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
apertura URL 'https://cloud.r-project.org/src/contrib/RcppNumerical_0.4-0.tar.gz'
Content type 'application/x-gzip' length 143327 bytes (139 KB)
==================================================
downloaded 139 KB
apertura URL 'https://bioconductor.org/packages/3.14/bioc/src/contrib/apeglm_1.16.0.tar.gz'
Content type 'application/x-gzip' length 1092965 bytes (1.0 MB)
==================================================
downloaded 1.0 MB
apertura URL 'https://bioconductor.org/packages/3.14/bioc/src/contrib/DiffBind_3.4.11.tar.gz'
Content type 'application/x-gzip' length 6762432 bytes (6.4 MB)
==================================================
downloaded 6.4 MB
ERROR: failed to lock directory ‘/home/posi/R/x86_64-pc-linux-gnu-library/4.1’ for modifying
Try removing ‘/home/posi/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-RcppEigen’
ERROR: dependency ‘RcppEigen’ is not available for package ‘RcppNumerical’
* removing ‘/home/posi/R/x86_64-pc-linux-gnu-library/4.1/RcppNumerical’
ERROR: dependencies ‘RcppEigen’, ‘RcppNumerical’ are not available for package ‘apeglm’
* removing ‘/home/posi/R/x86_64-pc-linux-gnu-library/4.1/apeglm’
ERROR: dependency ‘apeglm’ is not available for package ‘DiffBind’
* removing ‘/home/posi/R/x86_64-pc-linux-gnu-library/4.1/DiffBind’
The downloaded source packages are in
‘/tmp/RtmpOMlR7W/downloaded_packages’
Installation paths not writeable, unable to update packages
path: /usr/lib/R/library
packages:
spatial, survival
Messaggi di avvertimento:
1: In .inet_warning(msg) :
installation of package ‘RcppEigen’ had non-zero exit status
2: In .inet_warning(msg) :
installation of package ‘RcppNumerical’ had non-zero exit status
3: In .inet_warning(msg) :
installation of package ‘apeglm’ had non-zero exit status
4: In .inet_warning(msg) :
installation of package ‘DiffBind’ had non-zero exit status
I was also trying to install apeglm, RcppNumerical and RcppEpigen but it returns to me with the same error message of failure installation.
Thank you,
Regards

Related

Issues installing dada2 in R v.4.2.1

As the title states, I'm trying to install the dada2 library on R v. 4.2.1, for some upcoming eDNA analyses. However, when trying to run the following installation code:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("dada2", version = "3.15")
I get the following output:
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.15 (BiocManager 1.30.18), R 4.2.1 (2022-06-23
ucrt)
Old packages: 'brew', 'jsonlite', 'ragg', 'RCurl'
Update all/some/none? [a/s/n]:
When I update the old packages, I get the following output:
There are binary versions available but the source versions are
later:
binary source needs_compilation
jsonlite 1.8.1 1.8.2 TRUE
RCurl 1.98-1.8 1.98-1.9 TRUE
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/brew_1.0-8.zip'
Content type 'application/zip' length 78734 bytes (76 KB)
downloaded 76 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/ragg_1.2.3.zip'
Content type 'application/zip' length 1300158 bytes (1.2 MB)
downloaded 1.2 MB
package ‘brew’ successfully unpacked and MD5 sums checked
package ‘ragg’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\robinc4\AppData\Local\Temp\RtmpwR2WRF\downloaded_packages
installing the source packages ‘jsonlite’, ‘RCurl’
trying URL 'https://cran.rstudio.com/src/contrib/jsonlite_1.8.2.tar.gz'
Content type 'application/x-gzip' length 1053090 bytes (1.0 MB)
downloaded 1.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/RCurl_1.98-1.9.tar.gz'
Content type 'application/x-gzip' length 731611 bytes (714 KB)
downloaded 714 KB
The downloaded source packages are in
‘C:\Users\robinc4\AppData\Local\Temp\RtmpwR2WRF\downloaded_packages’
Warning messages:
1: package(s) not installed when version(s) same as current; use `force =
TRUE` to re-install: 'dada2'
2: In install.packages(update[instlib == l, "Package"], l, repos = repos, :
installation of package ‘jsonlite’ had non-zero exit status
3: In install.packages(update[instlib == l, "Package"], l, repos = repos, :
installation of package ‘RCurl’ had non-zero exit status
Afterwards, I tried this code:
install.packages("devtools")
library("devtools")
devtools::install_github("benjjneb/dada2", ref="v1.16") # change the ref argument to get other versions
And get following output:
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/devtools_2.4.4.zip'
Content type 'application/zip' length 429292 bytes (419 KB)
downloaded 419 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\robinc4\AppData\Local\Temp\RtmpwR2WRF\downloaded_packages
> library("devtools")
Loading required package: usethis
> devtools::install_github("benjjneb/dada2", ref="v1.16")
Downloading GitHub repo benjjneb/dada2#v1.16
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: RCurl (1.98-1.8 -> 1.98-1.9) [CRAN]
Enter one or more numbers, or an empty line to skip updates:
I update all old packages, which gives me the following:
GenomeInf... (NA -> 1.2.8 ) [CRAN]
RCurl (1.98-1.8 -> 1.98-1.9) [CRAN]
Installing 2 packages: GenomeInfoDbData, RCurl
There is a binary version available but the source version is
later:
binary source needs_compilation
RCurl 1.98-1.8 1.98-1.9 TRUE
installing the source packages ‘GenomeInfoDbData’, ‘RCurl’
trying URL 'https://bioconductor.org/packages/3.15/data/annotation/src/contrib/GenomeInfoDbData_1.2.8.tar.gz'
Content type 'application/x-gzip' length 11512907 bytes (11.0 MB)
downloaded 11.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/RCurl_1.98-1.9.tar.gz'
Content type 'application/x-gzip' length 731611 bytes (714 KB)
downloaded 714 KB
The downloaded source packages are in
‘C:\Users\robinc4\AppData\Local\Temp\RtmpwR2WRF\downloaded_packages’
Error: Failed to install 'dada2' from GitHub:
! System command 'Rcmd.exe' failed
In addition: Warning messages:
1: In i.p(...) :
installation of package ‘GenomeInfoDbData’ had non-zero exit status
2: In i.p(...) : installation of package ‘RCurl’ had non-zero exit status
I'm not sure what is going wrong here, and my colleagues aren't too sure either... Has anyone here had a similar issue?
Thanks a lot in advance!

Unable to install tmap

Tried to install the tmap package but encounter the below error
install.packages("tmap")
also installing the dependencies ‘tmaptools’, ‘sf’, ‘stars’, ‘classInt’
There are binary versions available but the source versions are later:
binary source needs_compilation
tmaptools 2.0-2 3.1 FALSE
sf 0.8-1 0.9-5 TRUE
stars 0.4-0 0.4-3 FALSE
classInt 0.4-2 0.4-3 TRUE
tmap 2.3-2 3.1 FALSE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel) no
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/sf_0.8-1.tgz'
Content type 'application/x-gzip' length 53770407 bytes (51.3 MB)
==================================================
downloaded 51.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/classInt_0.4-2.tgz'
Content type 'application/x-gzip' length 77560 bytes (75 KB)
==================================================
downloaded 75 KB
The downloaded binary packages are in
/var/folders/60/16nrd6w13g33nq3dpr441mgc0000gn/T//RtmphtcoT4/downloaded_packages
installing the source packages ‘tmaptools’, ‘stars’, ‘tmap’
trying URL 'https://cran.rstudio.com/src/contrib/tmaptools_3.1.tar.gz'
Content type 'application/x-gzip' length 39932 bytes (38 KB)
==================================================
downloaded 38 KB
trying URL 'https://cran.rstudio.com/src/contrib/stars_0.4-3.tar.gz'
Content type 'application/x-gzip' length 4745035 bytes (4.5 MB)
==================================================
downloaded 4.5 MB
trying URL 'https://cran.rstudio.com/src/contrib/tmap_3.1.tar.gz'
Content type 'application/x-gzip' length 2948495 bytes (2.8 MB)
==================================================
downloaded 2.8 MB
* installing *source* package ‘stars’ ...
** package ‘stars’ successfully unpacked and MD5 sums checked
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Error : package ‘sf’ 0.8.1 was found, but >= 0.9.0 is required by ‘stars’
ERROR: lazy loading failed for package ‘stars’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/stars’
Warning in install.packages :
installation of package ‘stars’ had non-zero exit status
ERROR: dependency ‘stars’ is not available for package ‘tmaptools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/tmaptools’
Warning in install.packages :
installation of package ‘tmaptools’ had non-zero exit status
ERROR: dependencies ‘tmaptools’, ‘stars’ are not available for package ‘tmap’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/tmap’
Warning in install.packages :
installation of package ‘tmap’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/60/16nrd6w13g33nq3dpr441mgc0000gn/T/RtmphtcoT4/downloaded_packages’
Issue solved by reinstalled R to the latest version

car package in Ubuntu machine 16.04

I can't install car package in R in an Ubuntu VM 16.04.
My last attempt was through terminal console of R.
The same result when I try to run it through R studio or using devtools
I receive the following errors:
> install.packages('car')
Installing package into ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘nloptr’, ‘lme4’, ‘pbkrtest’
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/nloptr_1.0.4.tar.gz'
Content type 'application/octet-stream' length 353957 bytes (345 KB)
==================================================
downloaded 345 KB
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/lme4_1.1-15.tar.gz'
Content type 'application/octet-stream' length 3610706 bytes (3.4 MB)
==================================================
downloaded 3.4 MB
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/pbkrtest_0.4-7.tar.gz'
Content type 'application/octet-stream' length 156406 bytes (152 KB)
==================================================
downloaded 152 KB
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/car_2.1-6.tar.gz'
Content type 'application/octet-stream' length 627349 bytes (612 KB)
==================================================
downloaded 612 KB
ERROR: failed to lock directory ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2’ for modifying
Try removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/00LOCK-nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/lme4’
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/pbkrtest’
ERROR: dependency ‘pbkrtest’ is not available for package ‘car’
* removing ‘/home/stefan/R/x86_64-pc-linux-gnu-library/3.2/car’
The downloaded source packages are in
‘/tmp/RtmpXR2ZjI/downloaded_packages’
Warning messages:
1: In install.packages("car") :
installation of package ‘nloptr’ had non-zero exit status
2: In install.packages("car") :
installation of package ‘lme4’ had non-zero exit status
3: In install.packages("car") :
installation of package ‘pbkrtest’ had non-zero exit status
4: In install.packages("car") :
installation of package ‘car’ had non-zero exit status

install.package() on RStudio on Amazon EC2 doesn't work. Package not available for R version 3.3.3

I've seen this: How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
and been through the list. No luck. I've also navigated via SSH to my library to see if there was some LOCK file or corrupt install. There is nothing there.
I literally just installed RStudio on Amazon EC2 and can't install the any new packages.
I've done it this way: https://aws.amazon.com/blogs/big-data/running-r-on-aws/
I've also used Ubuntu with Louis Anslett's AMI: http://www.louisaslett.com/RStudio_AMI/
I get the same problem in both. I have downloaded them manually and installed the tar.gz files from the temp directory. The CRAN repository seems to be fine because install.packages() downloads the tar.gz to /tmp/Rtmp2Rh9Zr/downloaded_packages/ just fine, but then the actual install process fails.
When I run install.packages("haven") for instance, it says
> install.packages("haven")
Installing package into ‘/home/jblocher/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependencies ‘R6’, ‘assertthat’, ‘rlang’, ‘Rcpp’, ‘readr’, ‘hms’, ‘tibble’, ‘BH’
trying URL 'https://cran.rstudio.com/src/contrib/R6_2.2.1.tar.gz'
Content type 'application/x-gzip' length 325641 bytes (318 KB)
==================================================
downloaded 318 KB
trying URL 'https://cran.rstudio.com/src/contrib/assertthat_0.2.0.tar.gz'
Content type 'application/x-gzip' length 11612 bytes (11 KB)
==================================================
downloaded 11 KB
trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.1.1.tar.gz'
Content type 'application/x-gzip' length 201419 bytes (196 KB)
==================================================
downloaded 196 KB
trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.11.tar.gz'
Content type 'application/x-gzip' length 2485092 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
trying URL 'https://cran.rstudio.com/src/contrib/readr_1.1.1.tar.gz'
Content type 'application/x-gzip' length 233793 bytes (228 KB)
==================================================
downloaded 228 KB
trying URL 'https://cran.rstudio.com/src/contrib/hms_0.3.tar.gz'
Content type 'application/x-gzip' length 7271 bytes
==================================================
downloaded 7271 bytes
trying URL 'https://cran.rstudio.com/src/contrib/tibble_1.3.1.tar.gz'
Content type 'application/x-gzip' length 91235 bytes (89 KB)
==================================================
downloaded 89 KB
trying URL 'https://cran.rstudio.com/src/contrib/BH_1.62.0-1.tar.gz'
Content type 'application/x-gzip' length 10181096 bytes (9.7 MB)
==================================================
downloaded 9.7 MB
trying URL 'https://cran.rstudio.com/src/contrib/haven_1.0.0.tar.gz'
Content type 'application/x-gzip' length 150016 bytes (146 KB)
==================================================
downloaded 146 KB
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘R6’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘assertthat’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘rlang’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘Rcpp’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘hms’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘BH’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘tibble’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘readr’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘haven’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpia0VEs/downloaded_packages’
When I install it using the already downloaded package, it says
> install.packages("/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz")
Installing package into ‘/home/jblocher/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz’ is not available (for R version 3.3.3)
If you are providing an archive file to install.packages you may need to specify repos=NULL:
install.packages("/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz", repos=NULL)
On my EC2 instance, I ran into the same problems when trying to install packages on RStudio, e.g., car, that involve RAM-intensive compilations. This could be fixed by adding swap space as described here
http://www.exegetic.biz/blog/2015/06/amazon-ec2-adding-swap/

How to install packages in R or Rstudio

when trying to install a package:
> install.packages("mlr")
Installing package into ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependencies ‘plyr’, ‘dplyr’, ‘lazyeval’ are not available
also installing the dependencies ‘scales’, ‘ggplot2’, ‘ggvis’, ‘reshape2’
trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.5.tar.gz'
Content type 'application/x-gzip' length 56346 bytes (55 Kb)
opened URL
==================================================
downloaded 55 Kb
trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb
trying URL 'http://cran.rstudio.com/src/contrib/ggvis_0.4.2.tar.gz'
Content type 'application/x-gzip' length 728345 bytes (711 Kb)
opened URL
==================================================
downloaded 711 Kb
trying URL 'http://cran.rstudio.com/src/contrib/reshape2_1.4.1.tar.gz'
Content type 'application/x-gzip' length 34693 bytes (33 Kb)
opened URL
==================================================
downloaded 33 Kb
trying URL 'http://cran.rstudio.com/src/contrib/mlr_2.4.tar.gz'
Content type 'application/x-gzip' length 440988 bytes (430 Kb)
opened URL
==================================================
downloaded 430 Kb
ERROR: dependency ‘plyr’ is not available for package ‘scales’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/scales’
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
ERROR: dependencies ‘dplyr’, ‘lazyeval’ are not available for package ‘ggvis’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/ggvis’
Warning in install.packages :
installation of package ‘ggvis’ had non-zero exit status
ERROR: dependency ‘plyr’ is not available for package ‘reshape2’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/reshape2’
Warning in install.packages :
installation of package ‘reshape2’ had non-zero exit status
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependencies ‘ggplot2’, ‘ggvis’, ‘plyr’, ‘reshape2’ are not available for package ‘mlr’
removing ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0/mlr’
Warning in install.packages :
installation of package ‘mlr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp3AjleG/downloaded_packages’
I keep getting th eerror" warning in install.packages insallation of package ... had non zero exit status.
What am I doing wrong? How do I Install MLR?
You have an outdated version of R. Normally dplyr and your other dependencies would be automatically installed, but in this case they are labelled as not working with older versions of R, so throw an error.
You have version 3.0.2, which is out of date. As of now the current version is 3.2.1. You should upgrade (you don't have the most up to date version of r-base, repos are often behind - try getting the binary from here).
If you don't want to update you can use the methods described in answers to this question to install older versions of the packages which may be compatible with your version - install older version of R package.

Resources