how to install rgdal package - r

I have been faced a problem when I tried ti install rgdal package in rstudio. Terminal caught this: Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
I tried this: > install.packages('rgdal',repos="http://www.stats.ox.ac.uk/pub/RWin")
but terminal caught: Warning in install.packages :
package ‘rgdal’ is not available (for R version 3.5.2)
I tried to reinstal sp. No reslut. How to fix it??
OS - Elementary OS 5.0
r version - 3.5.2

It should be sufficient to run install.packages('rgdal'). R will ask you to select a mirror where the "0-Cloud [https]" mirror should work. The package rgdal is available there. The mentioned repository http://www.stats.ox.ac.uk/pub/RWin does not provide the R package.

Related

Unable to install the disgenet2r package

library(devtools)
install_bitbucket("ibi_group/disgenet2r")
Unable to install dependencies such as SPARQL
ERROR: dependency ‘SPARQL’ is not available for package ‘disgenet2r’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/disgenet2r’
Warning messages:
1: package ‘SPARQL’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
2: In i.p(...) :
installation of package ‘/var/folders/43/7hr3j7q17tn0ns1g67l5vbq80000gn/T//Rtmptk5KoF/file2d1b24460f94/disgenet2r_0.99.2.tar.gz’ had non-zero exit status
Installing of library(disgenet2r) for further OMIM research
OK, so, the version of something needs to change. I will assume your R version will remain fixed.
I don't know what version of SPARQL you're on, but this is the latest:
install.packages("https://cran.r-project.org/src/contrib/Archive/SPARQL/SPARQL_1.16.1.tar.gz", repos=NULL, type="source")
Try it again after that. If it's still not working then try:
install.packages("devtools")
devtools::install_version("disgenet2r", version = "0.99.1")

Unable to install ggm package un R language

I'm currently operating in macOS with the R version of 3.6.3.
When I tried to install the package ggm, a warning occurred as follows.
Warning in install.packages :
dependency ‘graph’ is not available
also installing the dependency ‘igraph’
Then when it completed installing, it seemed not to work either:
ERROR: compilation failed for package ‘igraph’
* removing ‘/usr/local/lib/R/3.6/site-library/igraph’
ERROR: dependencies ‘igraph’, ‘graph’ are not available for package ‘ggm’
* removing ‘/usr/local/lib/R/3.6/site-library/ggm’
What is happening? I have searched for this error and didn't find anything that helps. Please help me. I'll be much appreciated!
I had the same problem.
To install the package graph you need to install the latest version of Bioconductor (i.e. package called BioManager).
Then you install the package graph and then simply run the installation for the ggm package.
install.packages("BiocManager")
BiocManager::install("graph")
install.packages("ggm")
library(ggm)
The package is then loaded into your R enviroment.

Caret package failed to install

I am getting this errors trying to install caret package:
ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’
Warning in install.packages :
installation of package ‘ddalpha’ had non-zero exit status
ERROR: dependency ‘ddalpha’ is not available for package ‘recipes’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/recipes’
Warning in install.packages :
installation of package ‘recipes’ had non-zero exit status
ERROR: dependency ‘recipes’ is not available for package ‘caret’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/caret’
Warning in install.packages :
installation of package ‘caret’ had non-zero exit status
Any ideas?
install.packages("ddalpha")
It gives the same error:
/usr/lib64/R/library/BH/include/boost/exception/exception.hpp:137: error: expected declaration before end of line
make: *** [AlphaProcedure.o] Error 1
ERROR: compilation failed for package ‘ddalpha’
* removing ‘/home/rspark/R/x86_64-redhat-linux-gnu-library/3.3/ddalpha’
I have found a solution.
I had the same problem. After installing caret with all its dependencies, ddalpha was not installed. Then I tried installing the package ddalpha alone. I got the message:
" There is a binary version available but the source version is later:
binary source needs_compilation
ddalpha 1.2.1 1.3.1 TRUE
Do you want to install from sources the package which needs compilation?
y/n: n"
Well, if I anwser yes, it doesn't work. But when I answer no, it does work. It looks like the new version has some problem, but the previous one works fine.
As Roman indicated in the comments, ddalpha and recipes are dependencies that aren't installed yet. You can manually install them as follows:
install.packages(c('ddalpha', 'recipes'))
Alternatively, you can tell the install.packages() command to grab the necessary packages during the install process.
install.packages('caret', dependencies=TRUE)
Or list them explicitly:
install.packages('caret', dependencies=c('ddalpha', 'recipes'))
Or, if you use an IDE such as RStudio, the package manager that's included will automatically handle these dependencies for you.
If these suggestions don't solve the problem, you may try updating your instance of R to the latest (3.4.1 as I write this). Also, ddalpha is dependent on the Rcpp package version 0.11.0 or greater, so you may update that package.
update.packages('Rcpp')
I was facing the same issues, and I had tried almost all the methods mentioned here. But the only one that worked for me was updating my IDE and that sorted it out.
I had the same issue, running
install.packages('caret', dependencies=TRUE)
from console solved it. I don't know why at the packages window install with "install dependencies" checked didn't work..
R studio: 2022.07.1
R: 3.6.3

Unable to install lme4 R package in Windows 10

I am trying to install lme4 with R studio on Windows 10, unsuccessfully. Apparently the nloptr package is not correctly installed. R returns the following error message:
>Warning in install.packages : installation of package ‘nloptr’ had non-zero exit status
then
>ERROR: dependency 'nloptr' is not available for package 'lme4'
and at the end
>Warning in install.packages : installation of package ‘lme4’ had non-zero exit status
When I started to use R studio in Windows I have followed this https://cran.r-project.org/bin/windows/Rtools/ and installed the Rtools, MikTex and InnoSetup.
If I try to install separately the package nloptr it does not work either and gives the same warning message.
Has this happened to anyone while installing lme4?

installation of package 'RHmm_2.0.3.tar.gz' had non-zero exit status in R

Actually, I would like to use the function “HMMFit” of package ”Rhmm” in R, but it cannot find the package. Then, I try to download this package in https://cran.r-project.org/. The version is RHmm_2.0.3.tar.gz. When I install this package, it warning me that “installation of package ‘RHmm_2.0.3.tar.gz’ had non-zero exit status”, and I cannot install it. I had search it in google, but I cannot find a useful solution.
Do you have some suggestion?
Thanks
P.S. I am using RStudio verison 0.99.491, R version 3.2.3 and MAC OX.

Resources