fcs2EQRSummaryMatrix: EQR Summary Matrix

Description Usage Arguments Value See Also

View source: R/fcs2EQRSummaryMatrix.R

Description

Produces a matrix summarising the single and joint EQRs and optionally comparing these to the observed catches and the FCS2 model's predictions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
fcs2EQRSummaryMatrix(
  fit1,
  ...,
  newData,
  joinByVar = NULL,
  subset = 1:nrow(newData),
  na.action,
  classify = !missing(boundaries),
  boundaries,
  summary = "mean",
  observations = TRUE,
  predictions = TRUE,
  n.samples = 1000,
  n.sims = 1000,
  eqrs,
  seed = NULL
)

Arguments

fit1

an "fcs2Fit" object containing a full FCS2 model fit, as returned from fcs2FitModel with runBUGS = TRUE.

...

further "fcs2Fit" objects, each resulting from a full FCS2 model fit with a different species.

newData

a data frame with surveys as rows and variables as columns. It should contain all variables required by each of the model fits. Covariates which are related to human disturbance (pressure variables) should have their values set to the value expected at the site if it were undisturbed (reference conditions) rather than the observed value for each of these variables.

joinByVar

the name of a column in dataFrame to be used for joining multiple surveys together when calculating the EQR. For example, joinByVar = "WBId" would produce EQR samples for each water body, with every survey in a water body contributing towards its EQR.
If NULL (the default), EQRs are calculated for each survey only.

subset

an optional vector specifying a subset of surveys to calculate EQR samples for.

na.action

a function which indicates what should happen when the data contain missing values (NAs). The default is set by the na.action setting of options and this is usually set to na.omit. This setting removes surveys that contain missing data in any required variables. Alternatively, na.pass can be used to ignore missing values (where possible) or na.fail can be given to signal an error if missing values are found.

classify

whether to produce probabilistic classifications of each WFD class. If joinByVar = NULL (the default), classifications are made using the joint EQR for each survey. If joinByVar is provided, classifications are made using the combined EQRs across multiple surveys.

boundaries

a vector of length 4 giving the EQR boundaries separating the classes Bad, Poor, Good, Moderate and High. This is used if classify = TRUE to produce probabilistic classifications of each class. If missing, regularly spaced boundaries of c(0.2, 0.4, 0.6, 0.8) are used with a warning.

summary

a character vector listing how to summarise the EQR variables. Can contain "mean" for the mean and/or "sd" to calculate the standard deviation.

observations

whether to give the observed total catch for each survey and species.

predictions

whether to summarise the model's predicted total catch for each survey and species. If TRUE (the default), the expected total catch is given but if "detail", the probability of presence (prevalence) and the expected total catch if present are alternatively given. If "all", all three columns are shown for each species.

n.samples

the number of Monte Carlo EQR samples to produce for each survey (or joining variable).

n.sims

the number of Monte Carlo simulations to make for each EQR sample. These internal samples are used for approximating the probability that defines the joint EQR.

eqrs

the result of fcs2JointAndSingleEQR with the above arguments can alternatively be given, to save recalculation if available.

seed

set random seed to allow repeatable results.

Value

a matrix with surveys as rows and columns containing the selected information.

See Also

fcs2JointAndSingleEQR


aquaMetrics/fcs2 documentation built on Aug. 21, 2021, 12:55 p.m.