as.double: Numeric Representations

as.double.qwR Documentation

Numeric Representations

Description

Converts data to numeric values: method for "qw" data.

Usage

## S3 method for class 'qw'
as.double(x, ...)

Arguments

x

the object to be converted.

...

further arguments passed to or from other methods.

Value

A numeric representation of x, using a method commonly refered to as simple substitution.

Note

The process of simple substitution proceeds in 4 steps for each kind of censoring: none, interval, left and right. First uncensored data are retained as is. Interval-censored data are converted by computing the mid rnge. Left-censored data are converted sequentially from the lowest censoring level, which is set to 1/2 the reporting level, any subsequent levels are replaced by the mean of all values less than the current reporting level. Conversion of right-censored data are not implemented in the current version and result in an error.

The function as.double is executed for as.numeric.

See Also

fillIn

Examples


## Create a simple qw object 
Test.qw <- as.qw(c(1,2,3,2,4,4), c("<", "<", "<", " ", " ", " "), "", NA_real_,
"Miss", "None", "Mine", "TEST", "")
as.double(Test.qw)
as.numeric(Test.qw)


USGS-R/smwrQW documentation built on Oct. 11, 2022, 6:13 a.m.