survtab: Lisa's Survival Summary Table

View source: R/survtab.R

survtabR Documentation

Lisa's Survival Summary Table

Description

This function creates a summary table from a survfit object including survival estimates with CIs, number of events, and number at risk. It returns a dataframe and prints a table using kable or htmlTable.

Usage

survtab(
  sfit,
  times,
  timelab = "Time",
  groups = NA,
  grlabs = NA,
  surv.dec = 2,
  perc = FALSE,
  color = "#EEEEEE",
  printorig = TRUE,
  kable = TRUE,
  htmlTable = FALSE,
  flextable = TRUE
)

Arguments

sfit

Survfit object (REQUIRED).

times

Numeric vector of times for survival estimates (REQUIRED).

timelab

Character label for time-points. Default = "Time".

groups

Character vector for groups as listed in dataset. Default = NA (no groups).

grlabs

Character vector for group names, must be in same order as groups. Default = NA (no groups or use group levels from dataset).

surv.dec

Number of decimal places to report for survival estimates. Default = 2.

perc

Logical indicator to report survival estimates as percentages. Default = FALSE.

color

Character Hex color to use for htmlTable striping. Default = "#EEEEEE" (light grey).

printorig

Logical indicator to print original summary of survfit object for checking purposes. Default = TRUE.

kable

Logical. Indicator to use kable to display table. Default = FALSE

htmlTable

Logical. Indicator to use htmlTable package to display table instead of kable Default = FALSE.

flextable

Logical. Indivator to use flextable to print table. Default = TRUE.


lisaerein/nicesurv documentation built on Dec. 9, 2024, 12:17 a.m.