unSurv | R Documentation |
Converts Surv object into a 3-column matrix
unSurv(x, col_lo = "lo", col_hi = "hi")
x |
vector (Surv object) |
col_lo |
Output column name for "lo" values. Default = "lo" |
col_hi |
Output column name for "hi" values. Default = "hi" |
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".
Returns a 3-column matrix: lo, hi, type
makeSurvDF
, unSurvDF
, impute
, imputeDF
, saveDF
,
df1 <- dataCensored[dataCensored$station=="CB3.3C"
& dataCensored$date < as.POSIXct("1985-08-01")
, c("station","date","chla")]
colnames(df1)
# Default values
chla_1 <- unSurv(df1$chla)
colnames(chla_1)
# User values
chla_2 <- unSurv(df1$chla, "LOW", "HIGH")
colnames(chla_2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.