unSurv {baytrends}R Documentation

Converts Surv object into a 3-column matrix

Description

Converts Surv object into a 3-column matrix

Usage

unSurv(x, col_lo = "lo", col_hi = "hi")

Arguments

x

vector (Surv object)

col_lo

Output column name for "lo" values. Default = "lo"

col_hi

Output column name for "hi" values. Default = "hi"

Details

The third column of the returned matrix (type) has the following meanings:

1 – no censoring

2 – left censored ("less than in a survival sense", e.g., [-Inf to 10], <10)

3 – interval censored ("less than in a water quality sense", e.g., "0 - <3", "1 - 3")

NA – missing value

The user can specify the names of the low and high columns in the output. Defaults are "lo" and "hi".

Value

Returns a 3-column matrix: lo, hi, type

See Also

makeSurvDF, unSurvDF, impute, imputeDF, saveDF,

Examples

df1 <- dataCensored[dataCensored$station=="CB3.3C","chla"][1:30]
colnames(df1)
# Default values
df2 <- unSurv(df1)
colnames(df2)
# User values
df3 <- unSurv(df1, "LOW", "HIGH")
colnames(df3)


[Package baytrends version 2.0.5 Index]