run_model_abiotic: run_model_abiotic

Description Usage Arguments Details Value Examples

View source: R/run_model_abiotic.R

Description

Run the model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
run_model_abiotic(
  data,
  parameters,
  abiotic,
  probs = c(0.05, 0.95),
  plot_area = NULL,
  years,
  save_each = NULL,
  return_seedlings = FALSE,
  return_nested = FALSE,
  return_tibble = TRUE,
  verbose = TRUE
)

Arguments

data

Data.table with input data.

parameters

List with all parameters..

abiotic

RasterLayer with abiotic conditions. Should be scaled to -1 <= x <= 1.

probs

Quantiles used for bad and good habitat threshold.

plot_area

The plot area as owin object from the spatstat package.

years

Numeric timesteps (years) the model runs.

save_each

Integer value specifying time step results are saved.

return_seedlings

Logical if seeds should be included in final output.

return_nested

Logical if TRUE the final tibble is nested.

return_tibble

Logical if tibble should be returned

verbose

If TRUE, prints progress report.

Details

Wrapper function to run the model. Executes (i) simulate_ci (ii) simulate_growth (iii) simulate_seed_dispersal (iv) simulate_mortality. The input data must be preprocessed using prepare_input.

Parameters include ....

Value

data.table or tibble

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
data <- prepare_data(data = example_input_data,
x = "x_coord", y = "y_coord", type = "Class", dbh = "bhd")

threshold <- quantile(data$dbh, probs = 0.8)

plot_area <- spatstat::owin(xrange = c(0, 500), yrange = c(0, 500))

ppp_threshold <- spatstat::ppp(x = data[dbh > threshold, x],
y = data[dbh > threshold, y], window = plot_area)

abiotic <- spatstat::density.ppp(ppp_threshold,  dimyx = c(250, 250))
abiotic <- dplyr::mutate(tibble::as_tibble(abiotic),
value = scales::rescale(value, to = c(-1, 1)))
abiotic <- raster::rasterFromXYZ(abiotic)

parameters <- read_parameters(file = "inst/parameters_abiotic.txt", sep = ";")

result <- run_model_abiotic(data = data, parameters = parameters, years = 10,
abiotic = abiotic, plot_area = plot_area)

## End(Not run)

mhesselbarth/rabmp documentation built on Nov. 24, 2021, 10:30 p.m.