Description Usage Arguments Details Value Examples
View source: R/run_model_abiotic.R
Run the model
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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 |
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. |
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 ....
data.table or tibble
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.