Converts Surv objects in a dataframe to "lo" (i.e., lower) and "hi" (i.e., upper) values. The user can specify their own values or use the defaults.

unSurvDF(df, suf_lo = "_lo", suf_hi = "_hi")

Arguments

df

dataframe with Surv objects

suf_lo

Column name suffix for "lo" values. Default = "_lo"

suf_hi

Column name suffix for "hi" values. Default = "_hi"

Value

Returns dataframe with censored data converted to lo/hi format

Examples

df <- dataCensored[dataCensored$station=="CB3.3C", ][1:20,]
colnames(df)
#>  [1] "station"  "date"     "layer"    "secchi"   "salinity" "do"      
#>  [7] "wtemp"    "tss"      "chla"     "din"      "nh4"      "no23"    
#> [13] "po4"      "tdn"      "tdp"      "tn"       "tp"      
# Default values
df2 <- unSurvDF(df)
colnames(df2)
#>  [1] "station"  "date"     "layer"    "secchi"   "salinity" "do"      
#>  [7] "wtemp"    "tss"      "chla_lo"  "chla_hi"  "din_lo"   "din_hi"  
#> [13] "nh4_lo"   "nh4_hi"   "no23_lo"  "no23_hi"  "po4_lo"   "po4_hi"  
#> [19] "tdn_lo"   "tdn_hi"   "tdp_lo"   "tdp_hi"   "tn_lo"    "tn_hi"   
#> [25] "tp_lo"    "tp_hi"   
# User values
df3 <- unSurvDF(df, "_LOW", "_HIGH")
colnames(df3)
#>  [1] "station"   "date"      "layer"     "secchi"    "salinity"  "do"       
#>  [7] "wtemp"     "tss"       "chla_LOW"  "chla_HIGH" "din_LOW"   "din_HIGH" 
#> [13] "nh4_LOW"   "nh4_HIGH"  "no23_LOW"  "no23_HIGH" "po4_LOW"   "po4_HIGH" 
#> [19] "tdn_LOW"   "tdn_HIGH"  "tdp_LOW"   "tdp_HIGH"  "tn_LOW"    "tn_HIGH"  
#> [25] "tp_LOW"    "tp_HIGH"