Skip to contents

This function generates plots for the variance partitioning of an Hmsc model. It can optionally compute the variance partitioning if not available on disk, supporting parallel computation and using TensorFlow; see VarPar_Compute. It plots the relative variance partitioning sorted by the mean value per predictor or by the original species order. It also plots the raw variance partitioning (relative variance partitioning multiplied by the Tjur-R^2 value). The plots are saved as JPEG files.

Usage

VarPar_Plot(
  Path_Model,
  EnvFile = ".env",
  VarParFile = NULL,
  FromHPC = TRUE,
  UseTF = TRUE,
  TF_Environ = NULL,
  NCores = 1,
  Fig_width = 30,
  Fig_height = 15,
  axis_text = 4
)

Arguments

Path_Model

Character path for the model file.

EnvFile

String. Path to read the environment variables. Default value: .env

VarParFile

Character. Name of the output file to save the results.

FromHPC

Logical. Indicates whether the function is being run on an HPC environment, affecting file path handling. Default: TRUE.

UseTF

Logical indicating whether to use TensorFlow for calculations. Defaults to TRUE.

TF_Environ

Character string specifying the path to the Python environment. Defaults to NULL. This argument is required if UseTF is TRUE.

NCores

Integer. Number of parallel computations for computing variance partitioning using TensorFlow. See VarPar_Compute for more details. Default: 1.

Fig_width, Fig_height

Numeric. Width and height of the output plot in centimeters. Default: 30 and 15, respectively.

axis_text

Numeric. Size of the axis text. Default: 4.

Details

The function reads the following environment variables:

  • DP_R_TaxaInfo_RData (if FromHPC = TRUE) or DP_R_TaxaInfo_RData_Local (if FromHPC = FALSE) for the location of the TaxaList.RData file containing species information.

Author

Ahmed El-Gabbas