Skip to contents

This function retrieves detailed information on IASDT Species, optionally filtered by a specific IASDT species ID. It first loads environment variables from a given file, then reads a species list from a path specified in the environment variables. If a species ID SpID is provided, it only returns species information for the listed species, otherwise return the full list of IAS.

Usage

GetSpeciesName(SpID = NULL, EnvFile = ".env", FromHPC = TRUE)

Arguments

SpID

optional IASDT species ID for which detailed information is required. If not provided, the function returns the entire species list.

EnvFile

EnvFile A string specifying the path to the environment variables file. Default is ".env". This file must exist in the specified path; otherwise, the function will stop with an error message.

FromHPC

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

Value

A data frame containing species information. If a species ID SpID is provided, it only returns species information for the listed species, otherwise return the full list of IAS.

Details

The function reads the following environment variables:

  • DP_R_TaxaInfo (if FromHPC = TRUE) or DP_R_TaxaInfo_Local (if FromHPC = FALSE) for the location of the Species_List_ID.txt file containing species information.

  • DP_R_PA (if FromHPC = TRUE) or DP_R_PA_Local (if FromHPC = FALSE). The function reads the contents of the Sp_PA_Summary_DF.RData file from this path.

Author

Ahmed El-Gabbas