This script is designed to produce one (or several) raster map related to plant functional group results (richness, relative cover, light or soil CWM) for one (or several) specific FATE simulation year.

POST_FATE.graphic_mapPFG(
  name.simulation,
  file.simulParam = NULL,
  years,
  opt.stratum_min = 0,
  opt.stratum_max = 10,
  opt.doBinary = TRUE,
  opt.no_CPU = 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

years

an integer, or a vector of integer, corresponding to the simulation year(s) that will be used to extract PFG abundance and binary maps

opt.stratum_min

(optional) default 1.
An integer corresponding to the lowest stratum from which PFG abundances will be summed up

opt.stratum_max

(optional) default 10.
An integer corresponding to the highest stratum from which PFG abundances will be summed up

opt.doBinary

(optional) default TRUE.
If TRUE, abundance maps (absolute or relative) are systematically multiplied by binary maps (see Details)

opt.no_CPU

(optional) default 1.
The number of resources that can be used to parallelize the unzip/zip of raster files

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 one or several (one for each simulation year) list of raster and ggplot2 objects :

tab

cover

raster of relative coverage

DIV.0

raster of species richness

DIV.1

raster of Shannon entropy

DIV.2

raster of Simpson concentration

CWM.light

raster of light community weighted mean

CWM.soil

raster of soil community weighted mean

plot

cover

ggplot2 object, representing cover raster

richness

ggplot2 object, representing DIV.0 raster

CWM.light

ggplot2 object, representing CWM.light raster

CWM.soil

ggplot2 object, representing CWM.soil raster

POST_FATE_GRAPHIC_C_map_PFG_[...].pdf file is created containing up to four graphics :

map_PFGcover

to visualize the PFG cover within the studied area

map_PFGrichness

to visualize the PFG richness within the studied area

PFGlight

to visualize the light CWM within the studied area

PFGsoil

to visualize the soil CWM within the studied area

Three PFGrichness_YEAR_[...]_STRATA_all_q[...].tif files are created into the simulation results folder :

q0

PFG richness

q1

PFG Shannon entropy

q2

PFG Simpson concentration

Raster files are also created for cover, and light and soil CWM if those modules were selected (see PRE_FATE.params_globalParameters).

Details

This function allows to obtain, for a specific FATE simulation and a specific parameter file within this simulation, up to six raster maps and preanalytical graphics.

For each PFG and each selected simulation year, raster maps are retrieved from the results folders ABUND_perPFG_perStrata and BIN_perPFG_perStrata and unzipped. Informations extracted lead to the production of up to six graphics before the maps are compressed again :

  • map of PFG richness within each pixel, representing the sum of binary maps
    Richness is calculated with the Leinster & Cobbold 2012 Ecology framework which allows to give more or less importance to the commun species through the q parameter :

    q = 0

    species richness

    q = 1

    Shannon entropy

    q = 2

    Simpson concentration

  • map of PFG relative cover, representing the sum of relative abundance maps of all PFG
    (potentially above a height threshold defined by opt.stratum_min)

  • if light was activated (see PRE_FATE.params_globalParameters), community weighted mean of PFG light preferences (extracted from LIGHT parameter within LIGHT files, see PRE_FATE.params_PFGlight)

  • if soil was activated (see PRE_FATE.params_globalParameters), community weighted mean of PFG soil preferences (extracted from SOIL_CONTRIB parameter within SOIL files, see PRE_FATE.params_PFGsoil)

It requires that the POST_FATE.relativeAbund, (POST_FATE.graphic_validationStatistics) and POST_FATE.binaryMaps functions have been run and that the folders BIN_perPFG_allStrata and BIN_perPFG_perStrata exist.

If opt.doBinary = TRUE, abundance maps (absolute or relative) are systematically multiplied by binary maps extracted from BIN_perPFG_allStrata and BIN_perPFG_perStrata folders and produced by POST_FATE.binaryMaps function. This way, produced raster maps reflect the validated/refined predictions. opt.doBinary can be set to FALSE to reflect pure simulation results.

Author

Maya Guéguen

Examples


if (FALSE) {                      
POST_FATE.graphic_mapPFG(name.simulation = "FATE_simulation"
                         , file.simulParam = "Simul_parameters_V1.txt"
                         , years = 850
                         , opt.stratum_min = 3
                         , opt.no_CPU = 1)
                                    
POST_FATE.graphic_mapPFG(name.simulation = "FATE_simulation"
                         , file.simulParam = "Simul_parameters_V1.txt"
                         , year = c(850, 950)
                         , opt.doBinary = FALSE)
}