mrg_cen_cols: Merge together observed concentrations and detection limits

Description Usage Arguments Value Examples

View source: R/cleaning_functions.R

Description

Merge a results column with a detection limits column by overwriting the censored results values with the corresponding detection limit.

Usage

1
mrg_cen_cols(qual, result, limit, nd = c("<", "nd", "ND"))

Arguments

qual

A character vector containing non-detect indicator strings, e.g., "<" or "ND". The strings used to indicate censored status can be edited in the "nd" argument.

result

A numeric vector of concentration measurements.

limit

A numeric vecotr of method detection limit/reporting limit values.

nd

A list indicating all the censoring flags included in the dataset. Defaults to "<", "nd", and "ND".

Value

A numeric vector.

Examples

1
2
3
4
5
result <- runif(5, 1, 10)
cen_result <- sample(c("<", ""), length(result), replace = TRUE)
method_limit <- rep(0.1, length(result))
result <- mrg_cen_cols(cen_result, result, method_limit)
print(data.frame(cen_result, result, stringsAsFactors = FALSE))

reasonabletools documentation built on Nov. 8, 2020, 4:24 p.m.