In this workshop we will use the spatstat
package in
R
(actually spatstat
is an umbrella for a
collection of packages):
library(spatstat)
## Loading required package: spatstat.data
## Loading required package: spatstat.geom
## spatstat.geom 2.4-0
## Loading required package: spatstat.random
## spatstat.random 2.2-0
## Loading required package: spatstat.core
## Loading required package: nlme
## Loading required package: rpart
## spatstat.core 2.4-4
## Loading required package: spatstat.linnet
## spatstat.linnet 2.3-2
##
## spatstat 2.3-4 (nickname: 'Watch this space')
## For an introduction to spatstat, type 'beginner'
Spatial data= data attributed to spatial locations
Three main types of spatial data:
This workshop is about the analysis of spatial point
patterns, and this is also the main focus of the
spatstat
package.
The “points” in a point pattern are the spatial locations where the
events or objects were observed. They are specified by spatial
coordinates. NOTE: In all that follows and for all
functions in spatstat
the coordinates are assumed to be
projected coordinates in Euclidean space. Do not
analyse geographic coordinates (latitude and longitude) directly in
spatstat
– project them first! (Using e.g. the
sf
package.)
The window \(W\) is the spatial region where points were (or could have been) observed.
Covariates are explanatory variables (which might “explain” any spatial variation in the abundance of points, for example).
Many covariates take the form of a function \(Z(u), \quad u \in W\) defined at every spatial location \(u\).
Alternatively, other kinds of spatial data can be treated as explanatory data. Usually we need to translate them into spatial functions for use in analysis.
Marks are attributes of the individual events or things.
In a spatial point pattern of trees, the trees might be classified into different species, and each tree carries a mark (“label”) indicating which species it belongs to.