0

I have recently switched from windows to ubuntu and can't make the rgdal package working properly.

I know there are a lot of posts on this but I just can't make it work.

I have installed gdal following https://gist.github.com/lossyrob/4348503 but still rgdal is in my list of installed packages according to rgdal%in%installed.packages() but when I include with library(rgdal) it returns Error in library(rgdal) : there is no package called ‘rgdal’.

Any help is appreciated.

Irene
  • 744
  • 1
  • 12
  • 36
  • I had seen that already, I ran $ sudo apt-get install libgdal1-dev libproj-dev installed and updated the apt-file I do not get any errors but I am not allowed to include the library. Am I missing something? – Irene Nov 21 '13 at 15:02
  • I just installed on my ubuntu desktop, its working , use install.packages("rgdal"),choose a cran mirror nearby you, see if that works. – PKumar Nov 21 '13 at 15:18
  • i tried to reinstall rgdal as suggested by @EDi and now it gives an error `configure: error: proj_api.h not found in standard or given locations. ERROR: configuration failed for package ‘rgdal’ * removing ‘/home/irene/R/i686-pc-linux-gnu-library/3.0/rgdal’` – Irene Nov 21 '13 at 15:43
  • sorry guys i feel superstupid but following the link @pradeep6kumar suggested i found the package needed with $ apt-file search proj_api.h libproj-dev: /usr/include/proj_api.h but how do I install it? because sudo apt-get install /usr/include/proj_api.h returns Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package /usr/include – Irene Nov 21 '13 at 15:58
  • I take the packages from the ubuntugis-unstable ppa. `sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable ; sudo apt-get update; sudo apt-get install libproj-dev` – EDi Nov 21 '13 at 18:50
  • When I run the update it returns 'Fetched 2,183 B in 1s (1,277 B/s) W: Failed to fetch http://ppa.launchpad.net/gm-notify-maintainers/ppa/ubuntu/dists/precise/main/source/Sources 404 Not Found W: Failed to fetch http://ppa.launchpad.net/gm-notify-maintainers/ppa/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.' – Irene Nov 22 '13 at 00:45

2 Answers2

0

So it was the gmail notifier after all that I had installed according to this post (in Italian sorry)...

This is how I did it, thanks to everybody, I wouldn't have made it without you guys!

So according to what was returned by sudo apt-get update and according to this post I unticked the similarly named PPA with the URL shown in the error message.

I re-ran what @EDi suggested sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable ; sudo apt-get update; sudo apt-get install libproj-dev and it worked like a charm!

I spent so much time on this.... Thanks everybody!

Community
  • 1
  • 1
Irene
  • 744
  • 1
  • 12
  • 36
0

I think there is also a binary package in the c2d4u repo:

sudo add-apt-repository ppa:marutter/c2d4u
sudo apt-get update
sudo apt-get install r-cran-rgdal

That way you don't have to compile it at all.

Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207