Note that the prediction data set must have x
and y
columns even if
these were not used in the model.
Usage
# S3 method for class 'dsm.var'
plot(
x,
poly = NULL,
limits = NULL,
breaks = NULL,
legend.breaks = NULL,
xlab = "x",
ylab = "y",
observations = TRUE,
plot = TRUE,
boxplot.coef = 1.5,
x.name = "x",
y.name = "y",
gg.grad = NULL,
...
)
Arguments
- x
a
dsm.var
object- poly
a
list
ordata.frame
with columnsx
andy
, which gives the coordinates of a polygon to draw. It may also optionally have a columngroup
, if there are many polygons.- limits
limits for the fill colours
- breaks
breaks for the colour fill
- legend.breaks
breaks as they should be displayed
- xlab
label for the
x
axis- ylab
label for the
y
axis- observations
should observations be plotted?
- plot
actually plot the map, or just return a
ggplot2
object?- boxplot.coef
control trimming (as in
summary.dsm.var
), only has an effect if the bootstrap file was saved.- x.name
name of the variable to plot as the
x
axis.- y.name
name of the variable to plot as the
y
axis.- gg.grad
optional
ggplot
gradient object.- ...
any other arguments
Details
In order to get plotting to work with dsm_var_prop
and
dsm_var_gam
, one must first format the data correctly
since these functions are designed to compute very general summaries. One
summary is calculated for each element of the list pred
supplied to
dsm_var_prop
and dsm_var_gam
.
For a plot of uncertainty over a prediction grid, pred
(a data.frame
),
say, we can create the correct format by simply using pred.new <- split(pred,1:nrow(pred))
.