
Summarize clinical metadata for survival analysis
SurvMetaSummary.RdPrints a formatted overview of a clinical metadata data frame, identifying
which columns are suitable for facet_row / facet_col in
SurvPlot, which columns look like survival time or event
indicators, and flagging columns with high missingness.
Arguments
- meta
Data frame of sample-level clinical metadata.
- max_levels
Integer (default
10). Columns with more unique non-NA values than this are treated as continuous and shown separately.- na_threshold
Numeric (default
0.5). Columns where more than this fraction of values areNAare flagged as high-missingness.- show_all
Logical (default
FALSE). IfTRUE, prints every column including those with >max_levelsunique values. Useful for large data frames where you want to see numeric columns too.
Value
Invisibly returns a data frame with one row per column containing:
column, type, n_unique, pct_na,
category (one of "survival_time", "survival_event",
"good_facet", "many_levels", "high_na",
"numeric"), and sample_values.
Examples
if (FALSE) { # \dontrun{
gbm <- LoadTCGA("TCGA-GBM")
SurvMetaSummary(gbm$meta)
# See all columns including numeric ones
SurvMetaSummary(gbm$meta, show_all = TRUE)
} # }