I'm new to Spatstat for R and I'm trying to add a point layer to a window I've created from a polygon. I see questions like this have been asked before but I still can't get what I need from the responses given. So far I have:
##Run libraries: library(“spatstat”) library(“maptools”) library(“sp”) library(“rgdal”) ##set the working directory setwd(“Z:/CP/spatstat/data/”) ##read in the shapefiles Points <- readOGR(getwd(), "MyPointShapefile") StudyArea <- readOGR(getwd(), "MyPolygonShapefile") ##create the window from polygon shp w <- as.owin(StudyArea)
How do I add the two together so the points are projected in the window?