library(spatstat)
data(nztrees)
mpl(nztrees, ~1, Poisson())
# fit the stationary Poisson process to 'nztrees'
# no edge correction needed
data(longleaf)
longadult <- longleaf[longleaf$marks >= 30, ]
longadult <- unmark(longadult)
mpl(longadult, ~ x, Poisson())
# fit the nonstationary Poisson process
# with intensity lambda(x,y) = exp( a + bx)
data(lansing)
# trees marked by species
mpl(lansing, ~ marks, Poisson())
# fit stationary marked Poisson process
# with different intensity for each species
mpl(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
data(ganglia)
mpl(ganglia, ~ marks * polynom(x,y,2), Poisson())</testonly>
Run the code above in your browser using DataLab