fullSimulationApp: Run full simulation, accepting all defaults

Description Usage Arguments Value Examples

View source: R/fullSimulationApp.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
24
25
26
27
28
29
30
31
32
33
34
35
36
fullSimulationApp(
  data,
  shp_reg = NULL,
  shp_app = 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 = NA,
  unit_converter = 1,
  covar_adjustment = 1,
  zero_break = FALSE,
  outlier_value = NA,
  dep_var_plot_label = "mm/yr",
  dep_var_plot_label_cumulative = "mm",
  line_plot_labels = c("Water yield", "Recharge"),
  line_plot_positive_vals_only = TRUE,
  line_plot_axis_label = "mm/yr",
  landcover_label_invasive = "Invasive",
  landcover_label_susceptible = "Susceptible",
  preview_plot_scalebar_position = "bottomright",
  preview_plot_scalebar_unit = "km",
  preview_plot_scalebar_dist = 10,
  priority_plot_scalebar_position = "bottomright",
  priority_plot_scalebar_unit = "km",
  priority_plot_scalebar_dist = 1,
  num_cores = parallel::detectCores() - 1
)

Arguments

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

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

shp_app

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)

unit_converter

numerical. A scalar to optionally modify the values of the resulting dependent variable (and modified dependent variable, if present) to convert units (e.g. mm/yr to gal/acre/day). Default value is 1.

covar_adjustment

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

zero_break

numerical. Should the priority plots have a breakpoint at 0 if values are both negative and positive?

outlier_value

numerical. Cutoff value for outliers in the priority plots.

dep_var_plot_label

character. Label for the dependent variable used in plots.

dep_var_plot_label_cumulative

character. Legend title for the cumulative change priority plot (also applied to modified values, if dep_var_modifier provided).

line_plot_labels

character vector of length 1 or 2, for dependent variable and modified dependent variable if provided, for the line graph. e.g. c('Water yield', 'Recharge')

line_plot_positive_vals_only

logical. When plotting the line graph, should the negative values be removed when aggregating by year?

num_cores

numerical. Number of cores for parallel processing, max 5

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.

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_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

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.