ggInteract_2D | R Documentation |
Function to draw 2D interaction plot showing predicted values for two predictors from a boosted regression trees obtained with the gbm.step routine in the dismo package. Values for all other variables are set at their mean by default.
ggInteract_2D(gbm.object, dat.rank = NULL, n.plots = NULL, x = 1, y = 2,
col.gradient = c("lightskyblue", "#142c42"), palette = NULL,
show.axis = F, show.dot = F, contour = T, label.contour = F,
col.contour = "cadetblue2", col.dot = "grey10", alpha.dot = 0.9,
cex.dot = 0.5, pred.means = NULL, x.label = NULL, y.label = NULL,
legend = TRUE, z.label = "Fitted value", x.range = NULL, nrow = NULL,
ncol = NULL, y.range = NULL, z.range = NULL, main = "",
smooth = "none", ...)
gbm.object |
a gbm.step object (object of S3 class gbm) |
dat.rank |
allows to plot several interaction plots using a data frame of interaction size (e.g. obtained from ggInteract_list) |
n.plots |
number of interaction plots to display, ranked by decreasing interaction size |
x |
in case of a single plot, the first predictor. Can be either a character name (use "") or a number indicating its index |
y |
in case of a single plot, the second predictor. Can be either a character name (use "") or a number indicating its index |
col.gradient |
a vector of two colors to define the color gradient of the plot |
palette |
use a predefined color palette (default = NULL) |
show.dot |
Logical. If TRUE (default=FALSE), overlays the actual data points |
contour |
Logical. If TRUE (default), draw contours |
label.contour |
Logical. If TRUE (default=FALSE), adds labels to the contours |
col.contour |
color of the contour lines |
col.dot |
color of the dots |
alpha.dot |
transparency of the dots |
cex.dot |
size of the dots |
pred.means |
allows specification of values for other variables (see gbm.perspec in dismo) |
x.label |
title for the x-axis |
y.label |
title for the y-axis |
legend |
Logical. If TRUE (default) shows the legend |
z.label |
title for the z-axis |
x.range |
manual range for the x-axis |
nrow |
number of plots per row |
ncol |
number of plots per column |
y.range |
manual range for the y-axis |
z.range |
manual range for the z-axis |
main |
title for the plot |
smooth: |
controls smoothing of the predicted surface |
nrow |
number of plots per row |
ncol |
number of plots per column |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.