0

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

Tyomik_mnemonic
  • 786
  • 3
  • 9
  • 31
  • 1
    do you get any other errors? linux based os's need some other non-r packages: [this](https://stackoverflow.com/questions/44382368/rgdal-installation-difficulty-on-ubuntu-16-04-lts) or [this](https://stackoverflow.com/questions/38213027/rgdal-installation-failed-on-ubuntu-14-04) *might* help – user20650 Jan 26 '19 at 23:53

1 Answers1

1

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.

  • when i run install.packages('rgdal') terminal caught: Warning in install.packages : installation of package ‘rgdal’ had non-zero exit status – Tyomik_mnemonic Jan 26 '19 at 22:35
  • 1
    The R instance where you try to install this package, can you ensure that you have the permission to install libraries? When the R libraries folder is write protected, then this error may occur. –  Jan 26 '19 at 22:42
  • 1
    @Tyomik_mnemonic: did you check the [CRAN page](https://cran.r-project.org/web/packages/rgdal/index.html)? It looks like you need a couple of non-R dependencies to be installed first. – bob1 Jan 27 '19 at 03:25
  • It looks similar to another [question](https://stackoverflow.com/questions/54386372/r-package-or-namespace-load-failed-for-forecast) regarding package loading. –  Jan 27 '19 at 09:22
  • @bob1 CRAN depends are ok. What did you mean about a couple of non-R dependencies to be installed first? gdal fo example? – Tyomik_mnemonic Jan 27 '19 at 17:10
  • 1
    @Tyomik_mnemonic, correct, though now that I look at it, these seem to be R dependencies that just need to be installed before rgdal. – bob1 Jan 27 '19 at 20:30
  • @bob1 I solve problem by instailing packages: $sudo apt-get install libgdal-dev and $sudo apt-get install libgdal-doc. I find it by $ apt-file search gdal-config. – Tyomik_mnemonic Jan 27 '19 at 21:25