R/acid_tol_index.R

Defines functions pct_acid_tol

Documented in pct_acid_tol

#==============================================================================
#'Acid Tolerance Index (ATI)
#'
#'@param Genus = Genus level taxa count data.
#'@return The percentage of Acid Tolerant Individuals (ATI).
#'@export

pct_acid_tol <- function(Genus){
  acid_taxa <- c("EPEORUS", "AMPHINEMURA", "LEUCTRA", "ISOPERLA", "RHYACOPHILA",
                 "SIMULIUM", "CONCHAPELOPIA", "CRICOTOPUS", "EUKIEFFERIELLA",
                 "HETEROTRISSOCLADIUS")
  final.df <- (rowSums(Genus[, names(Genus) %in% acid_taxa]) /
                 rowSums(Genus[, 6:ncol(Genus)])) * 100
  return(round(final.df, digits = 2))
}
zsmith27/BAP documentation built on April 23, 2023, 10:19 a.m.