Skip to content
Prev 24000 / 29559 Next

removing internal boundaries from a spatstat window that was created from three adjacent counties

In spatstat, I want to create a single window from three adjacent
counties in New York State, USA.  My original data is a shapefile,
"cty036" showing all the New York State county boundaries.  Here's what
I've done so far:

========== begin code =========
library(shapefiles)
library(spatstat)
library(maptools)
library(sp)
library(RColorBrewer)
library(rgdal)

nysArea <- readOGR("C:/DATA/GeographicData", "cty036")

nysAreaUTM <- spTransform(nysArea, CRS("+proj=utm +zone=18 +ellps=GRS80
+units=m +no_defs"))

sremsAreaUTM <- subset(nysAreaUTM, NAME=="Broome" | NAME=="Tioga" |
NAME=="Chenango")

sremsWindow <- as(sremsAreaUTM, "owin")
======== end code =============


This works pretty well, producing a 3-county owin object. But the
dividing lines between the counties are shown in the window, whenever I
plot it or plot subsequent point patterns that use the window.  In
essence, in plots it looks like 3 polygons instead of one big one. I'd
prefer not to have the inter-county boundaries be visible--I'd rather
have just one big polygon for the whole area. How can I remove them?  Or
should I create the window differently from the get-go?

Thanks.

--Chris