View source: R/response_curve.R
| response_curve | R Documentation |
A view of variable responses in models. Responses based on single or multiple models can be provided.
response_curve(fitted, variable, data = NULL, modelID = NULL, n = 100,
new_data = NULL, extrapolate = TRUE, show_lines = TRUE,
xlab = NULL, ylab = "Probability", col = "red", ...)
fitted |
an object of class |
variable |
(character) name of the variables to be plotted. |
data |
data.frame or matrix of data used in the model calibration step. Default = NULL. |
modelID |
(character) vector of ModelID(s) to be considered when the
fitted models is an |
n |
(numeric) an integer guiding the number of breaks. Default = 100 |
new_data |
a |
extrapolate |
(logical) whether to allow extrapolation to study the
behavior of the response outside the calibration limits. Ignored if
|
show_lines |
(logical) whether to show variable responses of distinct models as different lines. Default = TRUE. If |
xlab |
(character) a label for the x axis. The default, NULL, uses the
name defined in |
ylab |
(character) a label for the y axis. Default = "Probability". |
col |
(character) color for lines. Default = "red". |
... |
additional arguments passed to |
The function calculates these probabilities by focusing on a single environmental variable while keeping all other variables constant at their mean values.
When responses for multiple models are to be plotted, and show_lines =
FALSE, the mean and confidence intervals for the set of responses are
calculated using a GAM.
A plot with the response curve for a variable.
# Load a fitted selected model
data(sel_fit, package = "enmpa")
# Response curve for single models
response_curve(sel_fit, modelID = "ModelID_7", variable = "bio_1")
# Response curve when model(s) are in a list (only one model in this one)
response_curve(sel_fit, variable = "bio_12")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.