replaceBiasedSigma: Replace Biased Backscattering Cross Sections

Description Usage Arguments Details Value Examples

View source: R/replaceBiasedSigma.R

Description

Replace biased backscattering cross sections (sigma_bs in m^2) with averages from unbiased sigma_bs using cells in the same layer and (if possible) transect.

Usage

1
2
3
4
5
6
7
8
replaceBiasedSigma(
  df,
  varNv,
  varsigmabs,
  varTranLay,
  varLay = varTranLay[-1],
  Nvcut = 0.1
)

Arguments

df

A data frame containing the variables specified by name below.

varNv

A character scalar, the name of the variable in df containing a numeric vector of the number of fish per acoustic sampling volume.

varsigmabs

A character scalar, the name of the variable in df containing a numeric vector of the backscattering cross section, sigma_bs in m^2.

varTranLay

A character vector, the names of the variable in df used to identify unique transect-layers. Include names of other needed by variables if df contains information from multiple waterbodies or time periods.

varLay

A character vector, the names of the variable in df used to identify unique layers. The default, varTranLay[-1], assumes that the first variable names in varTranLay identifies the transect. This must be a subset of varTranLay. Include names of other needed by variables if df contains information from multiple waterbodies or time periods.

Nvcut

A numeric scalar, the cutoff for Nv (specified by VarNv), above which all sigma_bs are considered biased, default 0.1. Any sigma_bs with missing values are left unchanged.

Details

TS = 10*log10(sigma_bs).

Value

A numeric vector of target strengths, TS, in dB, same length as sigmabs.

Examples

1
2
3
4
5
mydf <- data.frame(nv=c(0.01, 0.1, 0.2, 0.2, 0.3, 0.05, 0.01),
  sig=1:7, tran=c(1, 1, 1, 2, 2, 1, 1), layer=c(1, 1, 1, 2, 2, 2, 2))
sig <- replaceBiasedSigma(df=mydf, varNv="nv", varsigmabs="sig",
  varTranLay=c("tran", "layer"))
cbind(mydf, sig)

JVAdams/EchoNet2Fish documentation built on Feb. 15, 2021, 4:27 a.m.