
Table with survival summary
tableSurvival.RdTable with survival summary
Arguments
- x
Result from estimateSingleEventSurvival or estimateCompetingRiskSurvival
- times
Times at which to report survival in the summary table
- timeScale
Time unit to report survival in: days, months or years
- header
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. Elements in header can be:
Any of the columns returned by
tableColumns(result)to create a header for these columns.Any other input to create an overall header.
- estimates
Character vector specifying which estimates to include in the table. Options include: "median_survival", "restricted_mean_survival", "q0_survival", "q05_survival", "q25_survival", "q75_survival", "q95_survival", "q100_survival". By default it includes c("median_survival", "restricted_mean_survival").
- type
Character string specifying the desired output table format. See
tableType()for supported table types. Iftype = NULL, global options (set viasetGlobalTableOptions()) will be used if available; otherwise, a default'gt'table is created.- groupColumn
Columns to use as group labels, to see options use
tableColumns(result). By default, the name of the new group will be the tidy* column names separated by ";". To specify a custom group name, use a named list such as: list("newGroupName" = c("variable_name", "variable_level")).*tidy: The tidy format applied to column names replaces "_" with a space and converts to sentence case. Use
renameto customise specific column names.- hide
Columns to drop from the output table. By default,
result_idandestimate_typeare always dropped.- style
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
Pre-defined style: Use the name of a built-in style (e.g.,
"darwin"). SeetableStyle()for available options.YAML file path: Provide the path to an existing
.ymlfile defining a new style.List of custome R code: Supply a block of custom R code or a named list describing styles for each table section. This code must be specific to the selected table type. If
style = NULL, the function will use global options (seesetGlobalTableOptions()) or an existing_brand.ymlfile (if found); otherwise, the default style is applied. For more details, see the Styles vignette on the package website.
- .options
A named list with additional formatting options.
visOmopResults::tableOptions()shows allowed arguments and their default values.
Examples
# \donttest{
cdm <- mockMGUS2cdm()
#> ■■■■■■■■■■■■■■■■■■■■■■■■■ 80% | ETA: 1s
surv <- estimateSingleEventSurvival(cdm,
targetCohortTable = "mgus_diagnosis",
outcomeCohortTable = "death_cohort")
#> - Getting survival for target cohort 'mgus_diagnosis' and outcome cohort
#> 'death_cohort'
#> Getting overall estimates
#> `eventgap`, `outcome_washout`, `censor_on_cohort_exit`, `follow_up_days`, and
#> `minimum_survival_days` casted to character.
tableSurvival(surv, times = c(50,100,365))
# }