[R-sig-Geo] MacOS spatial packages installation

Roger Bivand Roger.Bivand at nhh.no
Thu Jun 5 15:25:13 CEST 2014


This is a list, others may know the answer better than the person you 
named (me). Please ask on R-sig-mac. Note that Brian Ripley answered 
questions regarding spatial packages on Mavericks there:

https://stat.ethz.ch/pipermail/r-sig-mac/2014-April/010860.html

and later

https://stat.ethz.ch/pipermail/r-sig-mac/2014-May/010871.html

with a resolution - re-install rgdal and rgeos from CRAN-extras. Then 
you'll need to install maptools from source, I suppose. I don't know 
enough to know whether R 3.0.2 runs on 10.9.* at all. You'll need to 
specify a lot more about your underlying system (OS 10.9.3, which R 
version build for which system, etc.). My guess is that you have mixtures 
of versions of software.

maptools doesn't depend on rgdal or rgeos, but it hasn't been built for R 
3.1.0/Mavericks because of an unprotected call to rgeos::gDistance which I 
will protect, so maptools for OSX Mavericks should appear soon. This, 
however, is not your problem, I think.

Roger

On Thu, 5 Jun 2014, jwm302 wrote:

> Hi Roger
>
> I am really battling to get maptools package to work on on my system (OS X
> 10.9.3 Mavericks - see session at bottom of message). Everything was working
> fine but since I upgraded from R version 3.0 (2013-09-25) -- "Frisbee
> Sailing” to R 3.0.2 “Spring Dance”  (because suddenly the extract function
> wasn’t working anymore things started to break. 
>
> rgdal seems to be working because I am able to do commands like this with no
> error:  surfWater <- readOGR("Surface_water/gns_swb", "gns_swb”) 
>
> I have spent hours sifting through forum posts and the like, but all to no
> avail. Either I am missing something obvious, or I am not command line savy
> enough to find a solution . This forum (right at the bottom) seems to
> suggest that you don’t need to install map tools from source, that the
> binaries are available on CRAN. But I see over here
> (http://cran.r-project.org/web/packages/maptools/index.html) that OS X
> Mavericks binaries are not available. I am confused because I get conflicted
> results from my searching on forums. 
>
> I would just like to resolve the issue as soon as possible so that I can get
> on with my work.
>
> But as you can see, when I invoke maptools package I get a horrible looking
> error and R crashes (the same happens when I perform the same code from the
> command line 
> <http://r-sig-geo.2731867.n2.nabble.com/file/n7586556/Screen_Shot_2014-06-05_at_1.png>
> )):
>
>> sessionInfo()
> R version 3.1.0 (2014-04-10)
> Platform: x86_64-apple-darwin13.1.0 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] splines   grid      stats     graphics  grDevices utils     datasets 
> methods   base 
>
> other attached packages:
> [1] diagram_1.6.2     shape_1.4.1       data.table_1.9.2  tables_0.7.64 
> Hmisc_3.14-0      Formula_1.1-1     survival_2.37-7   lattice_0.20-29 
> xtable_1.7-1      texreg_1.32 
> [11] bootStepAIC_1.2-0 MASS_7.3-31       glm2_1.1.2        plyr_1.8 
> RMySQL_0.9-3      DBI_0.2-7         maps_2.3-6        maptools_0.8-29 
> gdalUtils_0.2.0   rgdal_0.8-16 
> [21] raster_2.2-12     sp_1.0-14 
>
> loaded via a namespace (and not attached):
> [1] cluster_1.15.2      codetools_0.2-8     foreach_1.4.1 
> foreign_0.8-61      iterators_1.0.6     latticeExtra_0.6-26
> RColorBrewer_1.0-5  reshape2_1.2.2      stringr_0.6.2 
>> 
>
>> packageInstallLoad <- function(x){
> +   for( i in x ){
> +     #  require returns TRUE invisibly if it was able to load package
> +     if( ! require( i , character.only = TRUE ) ){
> +       #  If package was not able to be loaded then re-install
> +       #setRepositories(ind = c(1,6))
> +       install.packages( i , dependencies = T )
> +       #  Load package after installing
> +       require( i , character.only = TRUE )
> +     }
> +   }
> + }
>> 
>> packageInstallLoad(c("raster", "rgdal", "gdalUtils", "maptools", "sp",
>> "maps", "RMySQL", "plyr", "stats", "glm2", "bootStepAIC", "texreg",
>> "xtable", "tables", "data.table", "diagram"))
> Loading required package: gdalUtils
> Loading required package: maps
> Loading required package: RMySQL
> Loading required package: DBI
> Loading required package: plyr
> Loading required package: glm2
> Loading required package: bootStepAIC
> Loading required package: MASS
>
> Attaching package: ‘MASS’
>
> The following objects are masked from ‘package:raster’:
>
>    area, select
>
> Loading required package: texreg
> Version:  1.32
> Date:     2014-05-01
> Author:   Philip Leifeld (University of Konstanz)
>
> Attaching package: ‘texreg’
>
> The following object is masked from ‘package:raster’:
>
>    extract
>
> Loading required package: xtable
>
> Attaching package: ‘xtable’
>
> The following object is masked from ‘package:maptools’:
>
>    label
>
> Loading required package: tables
> Loading required package: Hmisc
> Loading required package: grid
> Loading required package: lattice
> Loading required package: survival
> Loading required package: splines
> Loading required package: Formula
>
> Attaching package: ‘Hmisc’
>
> The following objects are masked from ‘package:xtable’:
>
>    label, label<-
>
> The following objects are masked from ‘package:plyr’:
>
>    is.discrete, summarize
>
> The following objects are masked from ‘package:raster’:
>
>    mask, zoom
>
> The following object is masked from ‘package:maptools’:
>
>    label
>
> The following object is masked from ‘package:rgeos’:
>
>    translate
>
> The following objects are masked from ‘package:base’:
>
>    format.pval, round.POSIXt, trunc.POSIXt, units
>
> Loading required package: data.table
> data.table 1.9.2  For help type: help("data.table")
> Loading required package: diagram
> Loading required package: shape
>
> Attaching package: ‘diagram’
>
> The following object is masked from ‘package:sp’:
>
>    coordinates
>
>> data(wrld_simpl)
>> kenya <- wrld_simpl[wrld_simpl$NAME == "Kenya",]
>
> *** caught segfault ***
> address 0x1150, cause 'memory not mapped'
>
> Traceback:
> 1: .Call(bboxCalcR_c, y at polygons)
> 2: wrld_simpl[wrld_simpl$NAME == "Kenya", ]
> 3: wrld_simpl[wrld_simpl$NAME == "Kenya", ]
>
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
> Selection:
>
> Thanks and Regards
> Justin Michell
>
>
>
>
>
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/MacOS-spatial-packages-installation-tp7583815p7586556.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no


More information about the R-sig-Geo mailing list