#' Acid WFD-AWIC metric
#'
#' @param data dataframe containing mixtaxon invertebrates
#' @param names
#' Optional, user provided list of column names different to those used
#' in `column_attributes` to match with input data
#' @param questions
#' Optional, user provided 'question' default is 'Taxon abundance', which
#' filters only abundance values.
#' @param metric_cols Columns used from taxon table to calculate metrics and
#' the taxon name column to join to input data (if using custom taxon table)
#' @param ... Pass in specific paramters for each metric.
#' @return dataframe
#' @export
#' @importFrom dplyr n select mutate any_of
#' @importFrom tidyr pivot_longer
#' @importFrom magrittr "%>%"
#' @importFrom rlang .data :=
#' @examples
#' metricResults <- calc_awic(demo_data)
calc_awic <- function(data,
names = macroinvertebrateMetrics::column_attributes$name,
questions = c(
"Taxon abundance",
"Taxon Abundance"
),
metric_cols = macroinvertebrateMetrics::metric_cols) {
data <- calc_metric(data,
metrics = "awic",
names = names,
questions = questions,
metric_cols = metric_cols
)
return(data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.