iterate: Iterate through species-removal robustness assessments in...

View source: R/iterate.R

iterateR Documentation

Iterate through species-removal robustness assessments in food webs

Description

Iterate through species-removal robustness assessments in food webs

Usage

iterate(
  fw_to_attack,
  probs_of_fw,
  alpha1,
  iter,
  i_index,
  plot = FALSE,
  export_plot = FALSE,
  plot_name = NULL
)

Arguments

fw_to_attack

Food web matrix to be attacked, a matrix.

probs_of_fw

Vector with the probability of attack to each node.

alpha1

Percentage of secondary extinctions after a primary extinction.

iter

Number of iterations to simulate.

i_index

Parameter, between 0 and 1 defining the probability of attacking hubs.

plot

Plot the results of the simulation (TRUE/FALSE).

export_plot

Should plots be exported to the working directory (TRUEFALSE)

plot_name

Plot file naming.

Value

A list of vectors with each metric.

Examples

data(mg1)
graph_list1 <- convert.to.graph.list(mg1)
#Create a vector with the values for the Intentionality Index (I)
i_index <- seq(from = 0, to = 1, by =0.01)
i_index <- head(i_index,-1)
fw1 <- graph_list1[[1]]
prob_exp <- exponent.removal(fw1, i_index)
it1 <- iterate(fw_to_attack=fw1, prob_exp, alpha1=50, iter=10, i_index, plot = TRUE)

FMestre1/fw_package documentation built on March 24, 2022, 1:27 a.m.