Learn R Programming

SWMPr (version 2.5.0)

cens_id: Flag observations above/below detection limits

Description

Flag observations above/below detection limits

Usage

cens_id(swmpr_in, ...)

# S3 method for swmpr cens_id(swmpr_in, flag_type = "both", select = NULL, ...)

Value

Returns a swmpr object with additional columns for censored flag values and the appropriate flag type based on the input arguments. Censored flag columns are named with a c_ prefix.

Arguments

swmpr_in

input swmpr object

...

optional arguments passed to or from other methods

flag_type

chr string indicating the flag type to return, must be one of 'below', 'above', or 'both', see details

select

chr string of parameters to keep, defaults to all, 'datetimestamp' will always be kept

Details

Censored observations are identified in swmpr objects using the CDMO flags -4 or -5, indicating outside the low or high sensor range, respectively. Additional codes are identified including A (-2007) or SUL (2007-) for above and B (-2007), SBL (2007-), SCB (2007-, calculated) for below detection limits. The QAQC columns are searched for all parameters and replaced with the appropriate value indicating the detection limit as defined by flag_type. The default argument flag_type = 'both' will recode the QAQC columns as -1, 0, or 1 indicating below, within, or above the detection limit. Setting flag_type = 'below' or 'above' will convert the columns to TRUE/FALSE values indicating observations beyond the detection limit (either above or below, TRUE) or within the normal detection range FALSE. The output includes additional columns similar to those for QAQC flags, such that the column names for censored flags include a c_ prefix before the parameter name. Note that the function will of course not work if already processed with qaqc. QAQC columns are retained for additional processing.

The user should refer to the metadata or visually examine the observed data to identify the actual limit, which may change over time.

See Also

qaqc

Examples

Run this code
## get data
data(apacpnut)
dat <- apacpnut

## convert all qaqc columns to censored flags, -1 below, 0 within, 1 above
cens_id(dat)

## T/F for above or within, note that none are above
cens_id(dat, flag_type = 'above')

## T/F for below or within
cens_id(dat, flag_type = 'below')

Run the code above in your browser using DataLab