rgdal not installing in R? "non-zero exit status?" - r

I am trying to install the package rgdal on a new MacOS 12.2.1. I have the newest version of R, and it has not been working much to my frustration. When I use the command "install.packages("rgdal")," a prompt is displayed: "Do you want to install from sources the package which needs compilation? (Yes/no/cancel)" I've tried this multiple times, selecting both yes and no, because I really have no idea what this prompt even means. Anyways, R downloads a bunch of necessary packages with no problem, but then when it gets to the end of the downloading process, this displays:
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rgdal’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/rgdal’
The downloaded source packages are in
‘/private/var/folders/t5/dqf_shjn2v79xfnycl1thkxh0000gn/T/Rtmpz3gATu/downloaded_packages’
Warning message:
In install.packages("rgdal") :
installation of package ‘rgdal’ had non-zero exit status
I have no idea what this means! I'm tired, confused, upset, I have little experience with coding at all and yeah this is just not an ideal situation! If anyone with more experience with R understands what is happening, I'd love help!
Thank you!

Related

How to solve an error when loading a package under development from git?

I am trying to install the interference package in R. The package is still under development, so one needs to install it from the website:
devtools::install_github('szonszein/interference', ref='0.1.0')
However, I receive the following error message:
ERROR: dependency ‘randnet’ is not available for package ‘interference’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/interference’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/sw/x2n7fwsj6p32wmcz0dfyk5p40000gn/T//RtmpVf6Xns/file58297d4fcf4a/interference_0.1.0.tar.gz’ had non-zero exit status
Even when I install radnet, however, things do not work. Any advice on how to deal with this?
I just tried that install, and it failed because randnet is not available. interference hasn't been updated in more than 2 years, so I think you'll have some work ahead of you: fork its repository, replace all references to randnet with something that is available.
randnet was removed from CRAN about 6 months ago because the authors were unresponsive to bug reports from CRAN. So an alternative would be to install the most recent (buggy!) version by downloading https://cran.r-project.org/src/contrib/Archive/randnet/randnet_0.5.tar.gz and installing that tar.gz file, but it appears the authors are no longer maintaining it, as is also the case for interference. I'd find a different solution.

Unable to install 'Velocyto.R' from Github

I am a beginner in R
trying to analyze my scRNA-seq data with velocyto.R in R studio.
Following velocyto tutorial, I tried installing velocyto.R as below:
library(devtools)
install_github("velocyto-team/velocyto.R")
But, an error pops up:
ERROR: compilation failed for package 'velocyto.R'
removing 'C:/Users/USER/Documents/R/win-library/3.6/velocyto.R'
Error: Failed to install 'velocyto.R' from GitHub:
(converted from warning) installation of package ‘C:/Users/USER/AppData/Local/Temp/RtmpukpRFl/file37346a812b86/velocyto.R_0.6.tar.gz’ had non-zero exit status
Is there anyone to face the same problem described above and succeed in resolving it after all?
I desperately need helps!
Thanks
As your error log says C:/..., you probably use Windows. According to velocyto's README it seems that this package runs only on unix-flavored systems with C++11, Open MP, boost, igraph and hdf5c++ libraries.
This can be the problem: read the velocyto's GitHub issue #40, maybe you'll need to run this under WSL...?

Problems installing GMMAT package into R-Studio v. 1.2.5033 & R-console v.3.6.0

This is the code I have been running: (as suggested)
install.packages (c("devtools", "RcppArmadillo", "CompQuadForm", "doMC",
"foreach", "Matrix", "BiocManager", "testthat"),
repos = "http://cran.r-project.org/")
BiocManager::install(c("SeqArray", "SeqVarTools"))
devtools::install_github("hanchenphd/GMMAT")
I receive the subsequent messages in my console:
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘GMMAT’ Do you want to attempt to
install these from sources? (Yes/no/cancel)
Enter: YES
And then:
ERROR: compilation failed for package ‘GMMAT’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/GMMAT’**
I have attempted to uninstall and re-install R-Studio and R-console, have updated the platforms, installed any necessary packages for R/Macbook, etc. and still cannot seem to fix this issue. Currently using a Macbook so domc is not the issue.
Any help you guys could provide would be great!

Cannot install tsDyn package in RStudio, 'mnormt' doesn't exist

I am trying to install the tsDyn package on my Macbook Pro running MacOSX Catalina version 10.15.2. in RStudio (v.1.3.959), running R (v.4.0.1). I get the following error:
ERROR: compilation failed for package ‘mnormt’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mnormt’
Warning in install.packages :
installation of package ‘mnormt’ had non-zero exit status
I tried installing 'mnormt' myself, as well as deleted all irrelevant packages manually to get rid of any possible older versions that may be interfering with the 'tsDyn' package, but nothing seems to be working.
The 'tsDyn' package seems to be installing otherwise, but I cannot call the function 'VECM' because it R states that it does not exist.
Any help would be much appreciated.
If you are using Anaconda, inside Environments search for "r-mnormt" and install from there. Also you can try inside RStudio:
install.packages("r-mnormt")
It should work now.

GenomicFeatures Package Installation Trouble

Sorry to be back so soon with a simple installation question, but my inability to solve it myself is seriously impairing my productivity. Anyway, I tried installing GenomicFeatures as suggested by the BC website.
> source("http://bioconductor.org/biocLite.R")
> biocLite("GenomicFeatures")
I received the following error messages (in addition to several warning messages)
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/RCurl’
ERROR: dependencies ‘XML’, ‘RCurl’ are not available for package ‘rtracklayer’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/rtracklayer’
ERROR: dependencies ‘XML’, ‘RCurl’ are not available for package ‘biomaRt’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/biomaRt’
ERROR: dependencies ‘rtracklayer’, ‘biomaRt’, ‘RCurl’ are not available for package ‘GenomicFeatures’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/GenomicFeatures’
So some problem with the dependencies I guess, but it seems strange that they would be automatically installed prior to GF. I am using version 2.15.0. Any clue as to what the problem might be? I'd be happy to provide more info as needed. Thanks.
Martin Morgan has a solution that I believe works in the comments. I'll elaborate on that a little bit.
The error messages are telling you that you need the RCurl and XML packages installed. Both of these packages require that your system has certain development packages on them. You appear to be running Linux. If you're using a Debian based system (Debian, Ubuntu, Mint, ...) then for RCurl to install you need to install libcurl4-openssl-dev and for XML to install you need to install libxml2-dev. You can accomplish this by relatively easily on the command line by typing
sudo apt-get install libcurl4-openssl-dev libxml2-dev
That should install the required packages and any dependencies. Then you should be able to install the RCurl and XML packages from within R.
install.packages("RCurl")
install.packages("XML")
At this point you have the required dependencies and should be able to install GenomicFeatures from Bioconductor.
source("http://bioconductor.org/biocLite.R")
biocLite("GenomicFeatures")
Just a note for those using Windows - getting RCurl and XML isn't necessarily easy, however, Dr. Brian Ripley provides binaries for these packages at his website and you can download them from there quite easily. Initially when I saw there was issues with RCurl and XML I thought it must be a windows user until I looked at the actual errors and realized it was a Linux user.

Resources