This function calculates all (or a subset) of the Structure and Functioning indicators for \(j\) areas and \(i\) years. The user can choose whether the function returns the indicator dataframe to the global environment, exports the dataframe to a .csv file, or both. The user can also choose whether the function returns the raw indicator values, the standardized (z-score) values, or both.
allStructure(X, X_length, LSI.group, LFI.group, max.length = 85,
large.fish = 35, guild.groups, condition.groups, ratio.groups,
species.table, speciesinfo.table, LenWt.table, years, raw = TRUE,
std = TRUE, glob.env = TRUE, export.path = NULL,
export.id = NULL)
A dataframe of fishery independent data derived from research vessel
survey data or model output, with columns YEAR
, ID
,
SPECIES
, and BIOMASS
. YEAR
indicates the year the
observation was recorded, ID
is an area code indicating where the
observation was recorded, SPECIES
is a numeric code indicating the
species sampled, and BIOMASS
is the corresponding biomass (stratified
and corrected for catchability as required).
A dataframe of fishery independent data derived from research
vessel survey data or model output, with columns YEAR
, ID
,
SPECIES
, LENGTH
, BIOMASS
and ABUNDANCE
.
YEAR
indicates the year the observation was recorded, ID
is an
area code indicating where the observation was recorded, and SPECIES
is a numeric code indicating the species sampled. LENGTH
is the
length class (cm) and BIOMASS
/ABUNDANCE
is the corresponding
biomass/abundance at length (stratified and corrected for catchability as
required). Species for which there are no length data should be assigned
LENGTH = -99
. These observations are removed by the function.
A character string indicating the species group for which to
calculate the Large Species Indicator. Must be set to "ALL"
or match
a column name in species.table
. If LSI.group = NULL
, the Large
Species Indicator will not be calculated.
A character string indicating the species group for which to
calculate the Large Fish Indicator. Must be set to "ALL"
or match a
column name in species.table
. If LFI.group = NULL
, the Large
Fish Indicator will not be calculated.
The threshold for large species (cm). Default is
max.length = 85
(i.e., large species are those with MAXLENGTH
>= 85 cm).
Threshold for large fish (cm). Default is large.fish =
35
(i.e., large fish are those with X_length$LENGTH
>= 35 cm).
A vector indicating the species groups for which to
calculate the resource potential. Each entry must be a character string
matching the name of a column in species.table
. If guild.groups
= NULL
, these indicators will not be calculated.
A vector indicating the species groups for which to
calculate Fulton's community condition factor. Each entry must be a
character string matching the name of a column in species.table
. If
condition.groups = NULL
, the community condition indicators will not
be calculated.
A dataframe with two columns, which must be named
group1
and group2
. Each row holds the group names for one
biomass ratio, with the numerator in column group1
and the
denominator in column group2
. Each entry must be a character string
matching the name of a column in species.table
or "ALL"
. If
ratio.groups = NULL
, biomass ratio indicators will not be calculated.
A table where the column names match the entries in
guild.groups
, ratio.groups
, and/or condition.groups
.
Column entries are the species codes indicating the species from X
(or X_length
) included in each group. species.table
may also
include columns for other species groups; these will be ignored.
A table with columns SPECIES
and the
corresponding TL
and MAXLENGTH
(trophic level and maximum
recorded length). Entries in the SPECIES
column should be the unique
values of species codes in X
/X_length
(or a subset thereof).
Other columns will be ignored.
A table of annual length at weight data with 5 columns.
YEAR
, ID
, and SPECIES
are as described in
X_length
. LENGTH
is fish length at the corresponding
WEIGHT
(fish weight).
A vector of years for which to calculate indicators.
A logical value. If raw = TRUE
, the raw indicator values are
returned by the function. If raw = FALSE
, the raw indicator values are
not returned. Default is raw = TRUE
. Either raw
or std
must be TRUE
.
A logical value. If std = TRUE
, the standardized indicator
values for each area ID
are returned by the function. Indicators are
standardized using z-scores, i.e., by subtracting the mean and dividing by
the standard deviation (ignoring NA
values). If std = FALSE
,
the standardized indicator values are not returned. Default is std =
TRUE
. Either raw
or std
must be TRUE
.
Logical value indicating whether to return output to global
environment. Default is glob.env = TRUE
.
File path indicating where to save a .csv file of
calculated indicators (named structure_export.id.csv; see below). If
export.file = NULL
, the indicator dataframe will not be exported as a
.csv file. Default is export.path = NULL
.
Character string to modify the name of the .csv file (if
export.path is specified), for example an area name or date of analysis. The
exported .csv file is named structure_export.id.csv. Default is
export.id = NULL
.
Returns a dataframe with columns ID
, YEAR
, and
indicators corresponding to the arguments supplied to the function.
Standardized indicators are noted with _s
in the name.
This function calculates the Structure and Functioning indicators: Biomass, Biomass Ratio(s), Large Species Indicator, Trophic Level of the Community, Large Fish Indicator, Mean Length (weighted by biomass and abundance), and Community Condition. If data are not available to calculate one or more of these indicators, a subset will be returned. See the help file for the individual functions for information on how each indicator is calculated.
Notes on indicator calculations: In the individual functions, the user
generally has control over which metric is used to calculate the indicator
(e.g., BIOMASS
or ABUNDANCE
). Here, BIOMASS
is used to
calculate Biomass, Biomass Ratio(s), Large Species Indicator, Large Fish
Indicator, Trophic Level of the Community, and Mean Length weighted by
biomass. ABUNDANCE
is used to calculate Mean Length weighted by
abundance and Community Condition. See individual functions for more
flexibility.
Bundy A, Gomez C, Cook AM. 2017. Guidance framework for the selection and evaluation of ecological indicators. Can. Tech. Rep. Fish. Aquat. Sci. 3232: xii + 212 p.
Other ecosystem structure and function indicators: biomassRatio
,
communityCondition
,
largeFishIndicator
,
largeSpeciesIndicator
,
meanTLCommunity
# NOT RUN {
# Compile data
data(X)
data(X_length)
data(species.table)
data(species.info)
data(Length_Weight)
# Species groups of interest
ratio.groups <- data.frame(rbind(c("PELAGIC", "GROUNDFISH"), c("PREDATORS", "ALL")))
names(ratio.groups) <- c("group1", "group2")
trophicguild.groups <- c("LBENTHIVORE", "MBENTHIVORE", "PISCIVORE", "PLANKTIVORE",
"ZOOPISCIVORE")
condition.groups <- c("FINFISH", "LBENTHIVORE", "MBENTHIVORE", "PISCIVORE",
"PLANKTIVORE", "ZOOPISCIVORE")
# Calculate raw indicators
allStructure(X = X, X_length = X_length,
LSI.group = "ALL", LFI.group = "ALL",
max.length = 85, large.fish = 35,
guild.groups = trophicguild.groups, condition.groups = condition.groups,
ratio.groups = ratio.groups,
species.table = species.table, speciesinfo.table = species.info,
LenWt.table = Length_Weight,
years = c(2014:2019), raw = TRUE, std = FALSE)
# }
Run the code above in your browser using DataLab