# NOT RUN {
<!-- %~~ simple examples of the most important functions ~~ -->
# }
# NOT RUN {
# Pretend that the data is given as a simple data frame
data <- as.data.frame(spruces) # from a spatstat data set
head(data) # x-y coordinates in a 56x38 m plot, marks are dbh in meters
data$marks = data$marks * 100 # dbh in cm
# Convert to a point pattern object
datap <- as.ppp(data, c(0, 56, 0, 38)) # plot limits (minx, maxx, miny, maxy)
# or datap <- ppp(data$x, data$y, c(0, 56), c(0, 38), marks = data$marks)
# Hegyi (1974) index (as usual without his original 1-foot distance offset)
hegyi <- pairwise(datap, maxR = 6, kernel = powers_ker, kerpar = list(pi=1,
pj=1, pr=1, smark=1))
head(marks(hegyi))
# ZOI model
zoi <- assimilation(datap, influence=zoi_inf, infpar=c(k=0.2, smark=1),
asym=1)
# }
Run the code above in your browser using DataLab