Learn R Programming

intSDM (version 2.1.1)

startWorkflow: startWorkflow: function to commence the integrated species distribution model workflow.

Description

Function to initialize the reproducible workflow using integrated species distribution models. The arguments for this function are used to specify which species and countries are to be studied, as well as how the results of the model should be saved (either as an R object or saved to some directory). This function outputs an R6 object with additional slot functions to help further customize the model specification. See ?species_model for more details on these functions.

Usage

startWorkflow(
  Countries,
  Species,
  Projection,
  Save = TRUE,
  Richness = FALSE,
  saveOptions = list(projectDirectory = NULL, projectName = NULL),
  Quiet = FALSE
)

Value

An R6 object of class species_model. This object contains a collection of slot functions to assist the user in customizing their workflow.

Arguments

Countries

A vector of country names to complete the analysis over. If missing, a boundary object (of class Spatial or sf) has to be added to the model using .$addArea before any analysis is completed.

Species

A vector of Species names (scientific) to include in the analysis. Names should be given carefully since the names provided will be used to obtain GBIF observations.

Projection

The coordinate reference system used in the workflow.

Save

Logical argument indicating if the model objects and outputs should be saved as .rds files. Defaults to TRUE. If FALSE then the output of the workflow will be a list of objects at each step of the workflow.

Richness

Logical option to create maps for each species individually, or create a species richness model. Defaults to FALSE.

saveOptions

A list containing two items: projectDirectory indicating where the objects should be saved (defaults to NULL), and projectName which indicates the name for the folder in the relevant directory. The latter argument is required, regardless of the value given to Save.

Quiet

Logical argument indicating if the workflow should provide the user messages during the setup and estimation process. Defaults to TRUE.

Examples

Run this code
##Start a workflow without saving objects

workflow <- startWorkflow(Species = 'Fraxinus excelsior',
                          Projection = "+proj=longlat +ellps=WGS84",
                          Save = FALSE,
                          saveOptions = list(projectName = 'example'))

Run the code above in your browser using DataLab