View source: R/plotSuitabilityToProba.R
plotSuitabilityToProba | R Documentation |
This function plots the relationships between the environmental suitability
and the probability of occurrence, which is used to generate the presence-
absence distribution.
It requires the output from convertToPA
.
plotSuitabilityToProba(sp, add = FALSE, ...)
sp |
the output from |
add |
|
... |
further arguments to be passed to |
Boris Leroy leroy.boris@gmail.com
# Create an example stack with two environmental variables
a <- matrix(rep(dnorm(1:100, 50, sd = 25)),
nrow = 100, ncol = 100, byrow = TRUE)
env <- c(rast(a * dnorm(1:100, 50, sd = 25)),
rast(a * 1:100))
names(env) <- c("variable1", "variable2")
parameters <- formatFunctions(variable1 = c(fun = 'dnorm', mean = 1e-04,
sd = 1e-04),
variable2 = c(fun = 'linearFun', a = 1, b = 0))
# Generation of the virtual species
sp1 <- generateSpFromFun(env, parameters)
sp1
# Converting to presence-absence, probablistic method, logistic conversion
# A species with a low prevalence:
sp1.lowprev <- convertToPA(sp1, species.prevalence = 0.1)
plotSuitabilityToProba(sp1.lowprev)
# A species with a high prevalence:
sp1.highprev <- convertToPA(sp1, species.prevalence = 0.9)
plotSuitabilityToProba(sp1.lowprev)
# Converting to presence-absence, probablistic method, linear conversion
# A species with a low prevalence:
sp1.lowprev <- convertToPA(sp1, species.prevalence = 0.1,
prob.method = "linear")
plotSuitabilityToProba(sp1.highprev)
# A species with a high prevalence:
sp1.highprev <- convertToPA(sp1, species.prevalence = 0.9,
prob.method = "linear")
plotSuitabilityToProba(sp1.highprev)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.