This script is designed to produce one graphical representation for a FATE simulation : the evolution through time of the total abundance and evenness of each habitat.

POST_FATE.graphic_evolutionStability(
  name.simulation,
  file.simulParam = NULL,
  movingWindow_size = 3,
  movingWindow_step = 1,
  opt.doPlot = TRUE
)

Arguments

name.simulation

a string corresponding to the main directory or simulation name of the FATE simulation

file.simulParam

default NULL.
A string corresponding to the name of a parameter file that will be contained into the PARAM_SIMUL folder of the FATE simulation

movingWindow_size

default 3.
An integer corresponding to the size (in years) of the moving window that will be used to calculate metrics of habitat stability

movingWindow_step

default 1.
An integer corresponding to the step (in years) between the years of the moving window

opt.doPlot

(optional) default TRUE.
If TRUE, plot(s) will be processed, otherwise only the calculation and reorganization of outputs will occur, be saved and returned

Value

A list containing two data.frame objects with the following columns, and one ggplot2 object :

tab.hab

HAB

concerned habitat

year

concerned simulation year

totalAbundance

total abundance over all the pixels within the concerned habitat

no.PFG

number of PFG over all the pixels within the concerned habitat

evenness

evenness over all the pixels within the concerned habitat

tab.stab

HAB

concerned habitat

no.years

number of simulation years used (moving window size)

yearStep

step between each simulation year of the moving window

yearStart

first simulation year of the moving window

yearEnd

last simulation year of the moving window

metric

concerned metric (either totalAbundance or evenness)

mean

mean value of the concerned metric over the years of the concerned moving window

sd

value of standard deviation of the concerned metric over the years of the concerned moving window

cv

value of coefficient of variation of the concerned metric over the years of the concerned moving window

plot.stab

ggplot2 object, representing the evolution of total abundance and evenness of each habitat

Two POST_FATE_TABLE_HAB_evolution_[...].csv files are created :

stability1

always, containing tab.hab

stability2

if successive years available, containing tab.stab

One POST_FATE_[...].pdf files is created :

GRAPHIC_A
stability

to visualize for each habitat the evolution of its total abundance and its evenness through simulation time

Details

This function allows to obtain, for a specific FATE simulation and a specific parameter file within this simulation, one preanalytical graphic :

  • the evolution of total abundance (FATE arbitrary unit) and evenness (between 0 and 1) of each habitat through simulation time, with evenness representing the uniformity of the species composition of the habitat (similar to Shannon entropy) : $$ \text{evenness} = - \frac{\Sigma(\text{proportion}_{\text{ PFG}_i} * log(\text{proportion}_{\text{ PFG}_i}))}{log(\text{no.PFG})} $$ with $$ \text{proportion}_{\text{ PFG}_i} = \frac{abund_{\text{ PFG}_i \text{, }\text{Habitat}_j}}{abund_{\text{ PFG}_{all}\text{, } \text{Habitat}_j}} $$

If the information has been provided (see POST_FATE.temporalEvolution), the graphics will be also done per habitat.

It requires that the POST_FATE.temporalEvolution function has been run and that the file POST_FATE_TABLE_PIXEL_evolution_abundance.csv exists.

Author

Ceres Barros, Maya Guéguen