allPressure: Calculates all Pressure indicators

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/allPressure.R

Description

This function calculates all (or a subset) of the Pressure 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.

Usage

1
2
3
allPressure(X, land, species.table, speciesinfo.table, landings.groups,
  FP.groups, minTL = c(0, 3.25), years, raw = TRUE, std = TRUE,
  glob.env = TRUE, export.path = NULL, export.id = NULL)

Arguments

X

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).

land

A dataframe of commercial landings data with columns YEAR, ID, SPECIES and CATCH. YEAR indicates the year the landing was recorded, ID is an area code indicating where the landing was recorded, SPECIES is a numeric code indicating the species landed, and CATCH is the corresponding landed weight (in the same units as BIOMASS in X).

species.table

A table where the column names match the entries in landings.groups. Column entries are the species codes indicating the species from land included in each group. species.table may also include columns for other species groups; these will be ignored.

speciesinfo.table

A table with columns SPECIES and the corresponding TL_LAND (trophic level of landed species). Entries in the SPECIES column should be the unique values of species codes in land (or a subset thereof). Other columns will be ignored.

landings.groups

A vector indicating the species groups for which to calculate the landings. Each entry must be a character string matching the name of a column in species.table. If landings.groups = NULL, no Landings indicators will be calculated.

FP.groups

A dataframe with two columns, which must be named group.land and group.X. Each row holds the group names to calculate the fishing pressure on a target group, with the numerator in column group.land and the denominator in column group.X. Each entry must be a character string matching the name of a column in species.table. If FP.groups = NULL, no fishing pressure indicators will be calculated.

minTL

A vector containing minimum trophic level to include when calculating the mean trophic level of the landings. Default is minTL = c(0, 3.25), which will return the mean trophic level of the landings and the marine trophic index.

years

A vector of years for which to calculate indicators.

raw

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.

std

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.

glob.env

Logical value indicating whether to return output to global environment. Default is glob.env = TRUE.

export.path

File path indicating where to save a .csv file of calculated indicators (named pressure_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.

export.id

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 pressure_export.id.csv. Default is export.id = NULL.

Details

This function calculates the Pressure indicators: Diversity of the Target Species, Total Landings, Landings of Target Groups, Fishing Pressure on the Community, Fishing Pressure on Target Groups, Mean Trophic Level of the Landings, and the Marine Trophic Index. 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.

Value

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.

Author(s)

Danielle Dempsey Danielle.Dempsey@dfo-mpo.gc.ca, Adam Cook, Catalina Gomez, Alida Bundy

References

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.

See Also

Other fishing pressure indicators: fishingPressure, landings, meanTLLandings, speciesRichness

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Compile data
data(X)
data(land)
data(species.table)
data(species.info)

# Species groups of interest
landings.groups <- c("ALL", "CLUPEIDS.L", "FLATFISH.L", "GROUNDFISH.L")
FP.groups <- data.frame(rbind(c("ALL", "ALL"),
   c("CLUPEIDS", "CLUPEIDS.L"),
   c("FLATFISH", "FLATFISH.L"),
   c("GROUNDFISH", "GROUNDFISH.L")))
names(FP.groups) <- c("group.X", "group.land")

# Calculate standardized indicators
allPressure(X = X, land = land, species.table = species.table,
   speciesinfo.table = species.info, landings.groups = landings.groups,
   FP.groups = FP.groups, minTL = c(0, 3.25), years = c(2014:2019), raw = FALSE, std = TRUE)

marindicators documentation built on Nov. 12, 2019, 5:07 p.m.