ppm(nztrees ~1, Poisson())
# fit the stationary Poisson process to 'nztrees'
# no edge correction needed
lon <- longleaf
<testonly>lon <- lon[seq(1, npoints(lon), by=50)]</testonly>
longadult <- unmark(subset(lon, marks >= 30))
ppm(longadult ~ x, Poisson())
# fit the nonstationary Poisson process
# with intensity lambda(x,y) = exp( a + bx)
# trees marked by species
lans <- lansing
<testonly>lans <- lans[seq(1, npoints(lans), by=30)]</testonly>
ppm(lans ~ marks, Poisson())
# fit stationary marked Poisson process
# with different intensity for each species
ppm(lansing ~ marks * polynom(x,y,3), Poisson())
# fit nonstationary marked Poisson process
# with different log-cubic trend for each species
<testonly># equivalent functionality - smaller dataset
ppm(amacrine ~ marks * polynom(x,y,2), Poisson())</testonly>
Run the code above in your browser using DataCamp Workspace