blank_col: Temporary vector with zero values

Description Usage Arguments Value

View source: R/group_metrics.R


Temporary vector with zero values


blank_col(taxon, wide.df)



The name of the taxon necessary for calculating a metric but is not found in the data set.


Taxonomic counts aggregated at the appropriate taxonomic rank in a wide data format. Use the wide function to prepare the data.


Creates a temporary vector containing zero values the length of the data frame specified by the object taxa.rank. Prevents errors created by missing taxon names necessary for metric calculations. For example, if no Trichoptera taxa were observed in the data set then there would be no column named "Trichoptera" in the wide order taxa.rank data frame. When metrics, such as pct_ept or pct_trichoptera, search for a column named "Trichoptera" a null value is returned and the function fails. Therefore, this function temporarly fills the missing columns with zeros and the metric can be calculated.

zsmith27/Benthos documentation built on June 23, 2017, 12:07 p.m.