Learn R Programming

survivalAnalysis (version 0.4.0)

write_survival_rates: Write survival rates for one or multiple survival analysis results in a CSV file.

Description

As write_survival takes potentially multiple objects, it cannot return its input in a cleanly defined way. You can still elegantly combine write_survival in a pipe followed by kaplan_meier_plot or kaplan_meier_grid for a single input object if you apply the tee pipe operator %T>% in front of write_survival.

Usage

write_survival_rates(
  ...,
  file,
  time_points,
  label = NULL,
  writer = write.csv,
  writer_args = list(),
  percentage_decimal_places = 1,
  time_precision = 0,
  timespan_unit = c("days", "months", "years")
)

Value

None (invisible NULL).

Arguments

...

Results generated by analyse_survival, or lists of such objects

file

A connection, or a character string naming the file to print to. (see cat)

time_points

Time points to compute survival rate at

label

A label describing the result, or a vector of the same size as results in ... (will then be mapped 1:1). Recommended to distinguish result lines from multiple results in ...

writer

A writer function such as write.csv

writer_args

Parameters to pass to the writer function

percentage_decimal_places, time_precision

Precision with which to print floating point values in their label form

timespan_unit

Unit for time spans: "days", "months" or "years"