5

Having difficulty installing some packages in a new R build on OSX Mavericks. Both rgeos and rgdal return e.g.:

package 'rgeos' is available as a source package but not as a binary

Warning in install.packages :
  package 'rgeos' is not available (for R version 3.1.1)

On my windows system both packages have installed fine for R 3.1.1, so is this a Mavericks/OSX version issue or do I have an issue with my build? Changing the library repository makes no difference. I've looked at building from binaries, but e.g. on the rgeos homepage it states "OS X Mavericks binaries: r-release: not available" so I'm snookered.

Grateful for advice.


Edit:

Trying the suggestion by @Andrie:

> install.packages('rgeos', type='source')
Installing package into ‘/Users/robinedwards/Library/R/3.1/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.ma.imperial.ac.uk/src/contrib/rgeos_0.3-6.tar.gz'
Content type 'application/x-gzip' length 240510 bytes (234 Kb)
opened URL
==================================================
downloaded 234 Kb

* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: clang
configure: CXX: clang++
configure: rgeos: 0.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 450
checking geos-config usability... 
./configure: line 2056: geos-config: command not found
no
configure: error: geos-config not usable
ERROR: configuration failed for package ‘rgeos’
* removing ‘/Users/robinedwards/Library/R/3.1/library/rgeos’
Warning in install.packages :
  installation of package ‘rgeos’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/_s/ppznw4sx7p51kwv__hj3d8540000gn/T/RtmpK40xj7/downloaded_packages’

And a screenshot of the build page:

enter image description here

geotheory
  • 22,624
  • 29
  • 119
  • 196
  • 1
    Have you tired `install.packages(..., type="source")` ? Also see the build page http://cran.r-project.org/web/checks/check_results_rgeos.html – Andrie Aug 15 '14 at 10:23
  • Hi Andrie, please see edits above – geotheory Aug 15 '14 at 10:38
  • 2
    you need to install the geos library package for OS X Maverick. – martin Aug 15 '14 at 10:41
  • But of course. Thanks martin/Andrie together you provide the solution. Who wants a green tick? – geotheory Aug 15 '14 at 13:47
  • @richie-cotton shouldn't the newer question be marked as 'duplicate'? – geotheory Dec 29 '14 at 17:40
  • In this case I think that generality trumps order of creation. I'm trying to get all info on package-not-available problems into one place. That question is community wiki, so if you want to add anything `rgdal`/`rgeos`-specific (or anything else useful), that would be great. – Richie Cotton Dec 29 '14 at 18:36

1 Answers1

7

You need to install rgdal and rgeos from source.

  1. First install the package rgeos
  2. Then install rgdal from source.

Try this:

install.packages('rgeos', type="source")
install.packages('rgdal', type="source")
thomasmichaelwallace
  • 7,926
  • 1
  • 27
  • 33
Andrie
  • 176,377
  • 47
  • 447
  • 496
  • 1
    Cheers. And for the homebrewer `brew install gdal` worked fine.. – geotheory Aug 15 '14 at 16:51
  • 1
    can someone explain why installing it from source works and is necessary? – ano Sep 13 '14 at 18:41
  • 3
    I have the same problem with rgeos not being available for R.3.13 so I have tried `install.packages('rgeos', type="source")` and `install.packages('rgdal', type="source")´ but these failed. Then i went to http://trac.osgeo.org/geos/ and downloaded http://download.osgeo.org/geos/geos-3.4.2.tar.bz2 In terminal i did the following which went well. `·/configure` `make` . But how the hell do i get the package into R: i have also tried `brew install gdal` but don't know how to get R to see the package. – jjunju Mar 31 '15 at 15:10
  • Version .3-15 of `rgeos` does not install correctly -- this is from source. Install the binary which works fine (version .3-11, I believe). – mrp Dec 05 '15 at 18:59
  • this seems not to work for rgdal in R 3.2: `install.packages("rgdal", type="source")` `package ‘rgdal’ is not available (for R version 3.2.3)` – Antonello May 19 '17 at 11:32
  • 2
    Worked out downloading `https://cran.r-project.org/src/contrib/Archive/rgdal/rgdal_1.2-5.tar.gz` and installing it with `R CMD INSTALL rgdal_1.2-5.tar.gz` – Antonello May 19 '17 at 11:43