Using help on this site I have already got the following code from where I can perform certain analyses. However, I'd now like to perform analyses on a certain variable (column z) within the point shapefile. To do this I need to establish 'marks' on column z (the 7th column). This column provides either a '4' or a '10', defining two types of point.
Can anyone assist?
##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)
##coerce the points to window
pts.ppp <- as.ppp(coordinates(Points), w)
plot(pts.ppp)