Given a model which has been fitted to point pattern data by recursive partitioning, plot the partition tree or the fitted intensity.
# S3 method for rppm
plot(x, …, what = c("tree", "spatial"), treeplot=NULL)
Fitted point process model of class "rppm"
produced by the function rppm
.
Character string (partially matched) specifying whether to plot the partition tree or the fitted intensity.
Arguments passed to plot.rpart
and text.rpart
(if what="tree"
)
or passed to plot.im
(if what="spatial"
)
controlling the appearance of the plot.
Optional. A function to be used to plot and label the partition tree,
replacing the two functions plot.rpart
and text.rpart
.
If what="tree"
, a list containing x
and y
coordinates of the plotted nodes of the tree.
If what="spatial"
, the return value of plot.im
.
If what="tree"
(the default), the partition tree will be plotted
using plot.rpart
, and labelled using
text.rpart
.
If the argument treeplot
is
given, then plotting and labelling will be performed by
treeplot
instead. A good choice is the function
prp
in package rpart.plot.
If what="spatial"
, the predicted intensity
will be computed using predict.rppm
, and
this intensity will be plotted as an image using plot.im
.
# NOT RUN {
# Murchison gold data
mur <- solapply(murchison, rescale, s=1000, unitname="km")
mur$dfault <- distfun(mur$faults)
#
fit <- rppm(gold ~ dfault + greenstone, data=mur)
#
opa <- par(mfrow=c(1,2))
plot(fit)
plot(fit, what="spatial")
par(opa)
# }
Run the code above in your browser using DataLab