View source: R/plot_response_surface.R
| plot_response_surface | R Documentation |
Plots response surfaces for any given pair of predictors in a rf(), rf_repeat(), or rf_spatial() model.
plot_response_surface(
model = NULL,
a = NULL,
b = NULL,
quantiles = 0.5,
grid.resolution = 100,
point.size.range = c(0.5, 2.5),
point.alpha = 1,
fill.color = viridis::viridis(100, option = "F", direction = -1, alpha = 0.9),
point.color = "gray30",
verbose = TRUE
)
model |
A model fitted with |
a |
Character string, name of a model predictor. If |
b |
Character string, name of a model predictor. If |
quantiles |
Numeric vector between 0 and 1. Argument |
grid.resolution |
Integer between 20 and 500. Resolution of the plotted surface Default: |
point.size.range |
Numeric vector of length 2 with the range of point sizes used by geom_point. Using |
point.alpha |
Numeric between 0 and 1, transparency of the points. Setting it to |
fill.color |
Character vector with hexadecimal codes (e.g. "#440154FF" "#21908CFF" "#FDE725FF"), or function generating a palette (e.g. |
point.color |
Character vector with a color name (e.g. "red4"). Default: |
verbose |
Logical, if TRUE the plot is printed. Default: |
All variables that are not a or b in a response curve are set to the values of their respective quantiles to plot the response surfaces. The output list can be plotted all at once with patchwork::wrap_plots(p) or cowplot::plot_grid(plotlist = p), or one by one by extracting each plot from the list.
A list with slots named after the selected quantiles, each one with a ggplot.
plot_response_curves()
Other visualization:
plot_evaluation(),
plot_importance(),
plot_moran(),
plot_optimization(),
plot_residuals_diagnostics(),
plot_response_curves(),
plot_training_df(),
plot_training_df_moran(),
plot_tuning()
data(plants_rf)
plot_response_surface(
model = plants_rf,
a = "climate_bio1_average",
b = "human_population",
grid.resolution = 50
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.