plot.bruSDM_predict {PointedSDMs}R Documentation

Generic plot function for predict_bru_sdm.

Description

Plot for predict_bru_sdm

Usage

## S3 method for class 'bruSDM_predict'
plot(
  x,
  whattoplot = c("mean"),
  cols = NULL,
  layout = NULL,
  colourLow = NULL,
  colourHigh = NULL,
  plot = TRUE,
  ...
)

Arguments

x

A bruSDM_predict object.

whattoplot

One of the following statistics to plot: "mean", "sd", "q0.025", "median","q0.975", "smin", "smax", "cv", "var"

cols

Number of columns required for the plotting. Used by inlabru's multiplot function.

layout

Layout of the plots. Used by inlabru's multiplot function.

colourLow

Colour for the low values in the predictions (see ?scale_colour_gradient from ggplot2). Defaults to NULL. If non-NULL, colourHigh is required.

colourHigh

Colour for the high values in the predictions (see ?scale_colour_gradient from ggplot2). Defaults to NULL. If non-NULL, colourLow is required.

plot

Should the plots be printed, defaults to TRUE. If FALSE will produce a list of ggplot objects.

...

Argument not used

Value

A ggplot2 object.

Examples

## Not run: 
 
 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')
 
 }

## End(Not run)


[Package PointedSDMs version 1.3.2 Index]