[R-sig-Geo] no boundaries between countries by using unionSpatialPolygons

Hans-Jörg Bibiko bibiko at eva.mpg.de
Wed Jan 7 16:00:44 CET 2009


On 07.01.2009, at 15:47, Roger Bivand wrote:
> Your ID has two unique values:
>> ID
> [1] (-67.1,-64.6] [-74.4,-71.9]
> Levels: [-74.4,-71.9] (-71.9,-69.5] (-69.5,-67.1] (-67.1,-64.6]

> with two country polygons:
>
>> length(slot(pe_bo_data, "polygons"))
> [1] 2
>
> so you get two output polygons. If you do:
>
> ID2 <- rep("pe_bo", length(slot(pe_bo_data, "polygons")))
> pe_bo <- unionSpatialPolygons(pe_bo_data, ID2)
>
> gives one output polygon:
>
>> length(slot(pe_bo, "polygons"))
> [1] 1
>
> and no boundary.

thank you so much for the prompt clarification!

Now I see, unionSpatialPolygons creates as many polygons as the number  
of unique IDs. You saved my day :)

Kind regards,

--Hans


**********************************************************
Hans-Joerg Bibiko
Max Planck Institute for Evolutionary Anthropology
Department of Linguistics
Deutscher Platz 6     phone:   +49 (0) 341 3550 341
D-04103 Leipzig       fax:     +49 (0) 341 3550 333
Germany               e-mail:  bibiko at eva.mpg.de




More information about the R-sig-Geo mailing list