metric.values: Calculate metric values

Description Usage Arguments Value Examples

View source: R/metric.values.R

Description

This function calculates metric values for bugs, fish, and algae. Inputs are a data frame of taxa, SampleID, and community. NonUnique = taxa to be excluded from taxa metrics (i.e., ambiguous taxa in the sample) Benthic Macroinvertebrates Required fields: SampleID (provided by user), Count, NonUnique, FinalID, Order, Family, Tribe, Genus, FFG, TolVal, Habit, Voltinism, BCG_Atr FFG = CF, CG, SC, SH, PR Habit = BU, CB, CN, SP, SW Voltinism = multivoltine, semivoltine, univoltine Fish Required fields: SampleID (provided by user), Count, NonUnique, FinalID, Genus, Trophic, Lithophil, StWidAvg, StLength, MassTotal Trophic = Lithophil = Stratum = Tolerance = Metric names have a prefix and suffix. The prefix follows the naming convention listed below. The suffix is a short name of the group being measured. Only phylogenetic names are first letter caps. ni = number of individuals nt = number of taxa pi = percent of individuals pt = percent of taxa x = index

Usage

1
2
metric.values(fun.DF, fun.SampID, fun.Community, fun.MetricNames = NULL,
  boo.Adjust = FALSE)

Arguments

fun.DF

Data frame of taxa (list required fields)

fun.SampID

Sample ID column name

fun.Community

Community name for which to calculate metric values (bugs, fish, or algae)

fun.MetricNames

Optional vector of metric names to be returned. If none are supplied then all will be returned.

boo.Adjust

Optional boolean value on whether to perform adjustments of values prior to scoring. Default = FALSE.

Value

data frame of SampleID and metric values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Index, Benthic Macroinvertebrates, genus
myIndex <- "MBSS.2005.Bugs"
# Thresholds
thresh <- metrics_scoring
# get metric names for myIndex
(myMetrics.Bugs <- as.character(droplevels(unique(thresh[thresh[,"Index.Name"]==myIndex,"Metric"]))))
# Taxa Data
myDF.Bugs <- taxa_bugs_genus
myMetric.Values.Bugs <- metric.values(myDF.Bugs, "SampleID", "bugs", myMetrics.Bugs)
View(myMetric.Values.Bugs)

# Index, Benthic Macroinvertebrates, family
myIndex <- "MSW.1999.Bugs"
# Thresholds
thresh <- metrics_scoring
# get metric names for myIndex
(myMetrics.Bugs <- as.character(droplevels(unique(thresh[thresh[,"Index.Name"]==myIndex,"Metric"]))))
# Taxa Data
myDF.Bugs <- taxa_bugs_family
myMetric.Values.Bugs <- metric.values(myDF.Bugs, "SampleID", "bugs", myMetrics.Bugs)
View(myMetric.Values.Bugs)

# Index, Fish
myIndex <- "MBSS.2005.Fish"
# Thresholds
thresh <- metrics_scoring
# get metric names for myIndex
(myMetrics.Fish <- as.character(droplevels(unique(thresh[thresh[,"Index.Name"]==myIndex,"Metric"]))))
# Taxa Data
myDF.Fish <- taxa_fish
myMetric.Values.Fish <- metric.values(myDF.Fish, "SampleID", "fish", myMetrics.Fish, TRUE)
View(myMetric.Values.Fish)

leppott/MMIcalc documentation built on May 21, 2019, 5:10 a.m.