
Last chance! 50% off unlimited learning
Sale ends in
predict_bru_sdm
.Plot for predict_bru_sdm
Plot for modISDM_predict
Plot for modMarks_predict
Plot for modSpecies_predict
# S3 method for bruSDM_predict
plot(
x,
whattoplot = c("mean"),
cols = NULL,
layout = NULL,
colourLow = NULL,
colourHigh = NULL,
plot = TRUE,
...
)# S3 method for modISDM_predict
plot(x, variable = "mean", plot = TRUE, ...)
# S3 method for modMarks_predict
plot(x, variable = "mean", plot = TRUE, ...)
# S3 method for modSpecies_predict
plot(x, variable = "mean", plot = TRUE, ...)
A ggplot2 object.
A ggplot2 object.
A ggplot2 object.
A ggplot2 object.
A modSpecies_predict object.
One of the following statistics to plot: "mean", "sd", "q0.025", "median","q0.975", "smin", "smax", "cv", "var"
Number of columns required for the plotting. Used by inlabru's multiplot function.
Layout of the plots. Used by inlabru's multiplot function.
Colour for the low values in the predictions (see ?scale_colour_gradient from ggplot2
). Defaults to NULL
. If non-NULL
, colourHigh
is required.
Colour for the high values in the predictions (see ?scale_colour_gradient from ggplot2
). Defaults to NULL
. If non-NULL
, colourLow
is required.
Should the plots be printed, defaults to TRUE
. If FALSE
will produce a list of ggplot objects.
Argument not used
One of the following statistics to plot: "mean", "sd", "q0.025", "median","q0.975", "smin", "smax", "cv", "var"
if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- intModel(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, responsePA = 'Present')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb')))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions, colourHigh = 'red', colourLow = 'orange')
}
}
if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- startISDM(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, responsePA = 'Present')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb')))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions, colourHigh = 'red', colourLow = 'orange')
}
}
if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- startMarks(data, Mesh = mesh,
Projection = proj, responsePA = 'Present',
markNames = 'speciesName',
markFamily = 'multinomial')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb',
diagonal = 1)))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions)
}
}
if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- startSpecies(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, responsePA = 'Present')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb')))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions, colourHigh = 'red', colourLow = 'orange')
}
}
Run the code above in your browser using DataLab