plot function

Generic plot function for predict_bru_sdm.

Generic plot function for predict_bru_sdm.

Plot for predict_bru_sdm

Plot for modISDM_predict

Plot for modMarks_predict

Plot for modSpecies_predict

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

Arguments

  • x: A modSpecies_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
  • variable: One of the following statistics to plot: "mean", "sd", "q0.025", "median","q0.975", "smin", "smax", "cv", "var"

Returns

A ggplot2 object.

A ggplot2 object.

A ggplot2 object.

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