fullSimulation: Run full simulation, accepting all defaults

Description Usage Arguments Value Examples

View source: R/fullSimulation.R

Description

This function runs the entire simulation by wrapping all other functions into a single function, accepting all default customization options

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
fullSimulation(
  data_as_directories = FALSE,
  data,
  shp_reg_directory = NULL,
  shp_reg_layer = NULL,
  shp_app_directory = NULL,
  shp_app_layer = NULL,
  convertFromUTM = FALSE,
  dat_sample = NULL,
  landcover_varname,
  reg_formula,
  landcover_invasive,
  landcover_susceptible,
  x_coords_varname,
  y_coords_varname,
  spread_rate,
  birdcell,
  simlength,
  simulation_count = 100,
  dep_var_modifier,
  covar_adjustment = NA,
  num_cores = parallel::detectCores() - 1
)

Arguments

data_as_directories

logical. TRUE if data and shapefiles must be loaded from files. FALSE if data and shapefiles are R objects already loaded in the environment.

data

data.frame if data is in environement, or character string specifying location of xlsx data with directory if data_as_directories = TRUE

shp_reg_directory

character string specifying directory of shapefile outlining the area of data to be used for the regression. NULL if data_as_directories = FALSE

shp_reg_layer

character string specifying layer (.shp) filename corresponding to shp_reg_directory, or spatial polygon object if data_as_directories = FALSE

shp_app_directory

character string specifying directory of shapefile outlining the area of data to which the final simulation will be applied, if different from shp_reg. NULL if data_as_directories = FALSE

shp_app_layer

character string specifying layer (.shp) filename corresponding to shp_app_directory, or spatial polygon object if data_as_directories = FALSE

convertFromUTM

logical. Set to TRUE if you are subsetting your data with shapefile(s) and your shapefile(s) are in UTM coordinates instead of lon/lat.

dat_sample

numerical. If specified, will take a sample of n observations for the regression (suggested if shp_reg has lots of observations)

landcover_varname

character string specifying the landcover variable from data

reg_formula

regression formula to be used, as in lm(), with columns from data (e.g. c ~ a + b)

landcover_invasive

value. Numerical or character value of the invasive landcover.

landcover_susceptible

value. Numerical or character value(s) of the susceptible landcover(s). If more than one susceptible landcover, provide a vector c().

x_coords_varname

character string. Name of the x-coordinate variable in data.

y_coords_varname

character string. Name of the y-coordinate variable in data.

spread_rate

numerical. Value between 0 and 1 indicating the annual spread rate of the invading landcover.

birdcell

numerical. Value between 0 and 1 indicating the probability a random cell can be invaded, regardless of adjacency to existing invaded pixels.

simlength

integer. Number of years the simulation should run.

simulation_count

integer. Length of simulation bootstrap.

dep_var_modifier

numerical. A scalar to optionally return a list of rasters with modified dep_var rasters (e.g. multiply water yield rasters to obtain recharge rasters)

covar_adjustment

list. List specifying change in covariate values. See ?gls_spatial_predict.

num_cores

numerical. Number of cores for parallel processing, max 5

Value

A list of all objects returned by the individual functions

Examples

1
TO DO

natedemaagd/LandCover documentation built on April 1, 2021, 4:14 p.m.