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
Christopher W. Ryan, MD, MS cryanatbinghamtondotedu https://www.linkedin.com/in/ryancw Early success is a terrible teacher. You?re essentially being rewarded for a lack of preparation, so when you find yourself in a situation where you must prepare, you can?t do it. You don?t know how. --Chris Hadfield, An Astronaut's Guide to Life on Earth