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

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


Hi,

I have a tiny problem. I'm using Roger Bivand's ( http://spatial.nhh.no/R/etc/TM_WORLD_BORDERS_SIMPL-0.2.RData 
  ) to create a plot showing two countries without boundaries. I did  
this:



library("foreign")
library("sp")
library("maptools")
library("gpclib")

load("TM_WORLD_BORDERS_SIMPL-0.2.RData")
pe_bo_data <- wrld_simpl[wrld_simpl$NAME %in% c("Bolivia","Peru"),]

lps <- coordinates(pe_bo_data)
ID <- cut(lps[,1], quantile(lps[,1]), include.lowest=TRUE)

pe_bo <- unionSpatialPolygons(pe_bo_data, ID, threshold = NULL)
plot(pe_bo)




but the plot still shows the boundary between Peru and Bolivia. I also  
tried to set a proper threshold but unfortunately no success.

What's wrong with my approach? I'd be glad for any hint!

I'm using R version 2.8.0 (2008-10-20) on Mac OSX 10.5.6 (Intel)


Thanks in advance,

--Hans




More information about the R-sig-Geo mailing list