baytrends (version 1.1.0)

as.lcens: Left-censored Data Conversion

Description

Converts data to a left-censored data (lcens) object: various methods.

Usage

as.lcens(values, detlim, censor.codes)

# S4 method for lcens,missing,missing as.lcens(values, detlim, censor.codes)

# S4 method for numeric,missing,missing as.lcens(values, detlim, censor.codes)

# S4 method for numeric,numeric,missing as.lcens(values, detlim, censor.codes)

# S4 method for numeric,numeric,logical as.lcens(values, detlim, censor.codes)

# S4 method for numeric,numeric,character as.lcens(values, detlim, censor.codes)

# S4 method for numeric,missing,logical as.lcens(values, detlim, censor.codes)

# S4 method for numeric,missing,character as.lcens(values, detlim, censor.codes)

# S4 method for qw,missing,missing as.lcens(values, detlim, censor.codes)

# S4 method for qw,numeric,missing as.lcens(values, detlim, censor.codes)

# S4 method for character,missing,missing as.lcens(values, detlim, censor.codes)

Arguments

values

numeric values representing "raw" values. Missing values are permitted. A vector of character strings is allowed when the remark code is combined with the value; blank values are treated as missing values, any other value is converted to a missing value with a warning. See Examples.

detlim

the corresponding detection limit of the sensor. Missing values are permitted. Detection limits are required for each non-missing value in values; they will be imputed if missing. The imputation scheme is fairly sophisticated, see Lorenz (in preparation) for details, so it is better to set to missing, rather than provide an arbitrary detection limit.

censor.codes

optional codes indicating a left-censored value. If class "logical," then TRUE indicates left-censored. If class "character," then "<" indicates left-censored and anything other than "" or " " generates a warning.

Value

An S4 object of class "lcens." These objects are the basis for the analysis of left-censored data.

References

Lorenz, D.L., in preparation

See Also

as.mcens

Examples

Run this code
# NOT RUN {
## The first value is censored at 2
as.lcens(c(1,3), 2)
## Set the first value to censored at that level and the detection limit is
# carried forward
as.lcens(c(1,3), censor.codes=c("<", ""))
# For combined remark and values:
as.lcens(c("<1", "1", "<1", "1", "2"))

# }

Run the code above in your browser using DataLab