plot method for BIOMOD.formated.data and BIOMOD.formated.data.PA object classR/biomod2_classes_1.R
plot.RdPlot the spatial distribution of presences, absences and
pseudo-absences among the different potential dataset (calibration,
validation and evaluation). Available only if coordinates were given to
BIOMOD_FormatingData.
# S4 method for class 'BIOMOD.formated.data,missing'
plot(
x,
calib.lines = NULL,
PA,
run,
plot.type,
point.size = 1.5,
plot.output,
plot.valid = TRUE,
plot.eval = TRUE,
do.plot = TRUE,
has.mask = FALSE,
has.mask.eval = FALSE
)a BIOMOD.formated.data or BIOMOD.formated.data.PA
object. Coordinates must be available to be able to use plot
(optional, default NULL)
A data.frame object returned by get_calib_lines or
bm_CrossValidation functions, to explore the distribution of calibration
and validation datasets
(optional, default 'all')
If x is a BIOMOD.formated.data.PA object, a vector
containing pseudo-absence set to be represented
(optional, default 'all')
If calib.lines is provided, a vector containing repetition set to
be represented
a character defining how occurrences will be represented.
Must be 'points' (default, better when using fine-grained data) or
'raster' (if environmental variables were given as a raster, better
when using coarse-grained data)
(optional, default 1.5)
If plot.type = 'points', a numeric to adjust the size of points
a character defining whether to return a single facet with
all plots or a list of individual plots, must be 'facet' (default)
or list
(optional, default TRUE)
A logical defining whether validation data should be separated on plot or not
(optional, default TRUE)
A logical defining whether evaluation data should be added to the plot or not
(optional, default TRUE)
A logical defining whether the plot is to be rendered or not
optional, default FALSE)
A logical defining whether a mask for calibration data is available or not
(optional, default FALSE)
A logical defining whether a mask for evaluation data is available or not
a list with the data used to generate the plot and a
ggplot2 object
library(terra)
# Load species occurrences (6 species available)
data(DataSpecies)
head(DataSpecies)
# Select the name of the studied species
myRespName <- 'GuloGulo'
# Get corresponding presence/absence data
myResp <- as.numeric(DataSpecies[, myRespName])
# Get corresponding XY coordinates
myRespXY <- DataSpecies[, c('X_WGS84', 'Y_WGS84')]
# Load environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
data(bioclim_current)
myExpl <- terra::rast(bioclim_current)
DONTSHOW({
myExtent <- terra::ext(0,30,45,70)
myExpl <- terra::crop(myExpl, myExtent)
})
## ----------------------------------------------------------------------- #
# Format Data with true absences
myBiomodData <- BIOMOD_FormatingData(resp.name = myRespName,
resp.var = myResp,
resp.xy = myRespXY,
expl.var = myExpl)
myBiomodData
plot(myBiomodData)