first_table_row: Row with type selected by firsttable

first_table_rowR Documentation

Row with type selected by firsttable

Description

Row with type selected by firsttable

Usage

first_table_row(
  data_item,
  data = NULL,
  data_filter = NULL,
  row_digits = NULL,
  na.rm = TRUE,
  reference_level = NULL,
  include_reference = NULL,
  workspace = NULL,
  non_parametric = NULL,
  row_digits_default = NULL,
  row_digits_surv = NULL,
  row_digits_numeric = NULL,
  cat_out_of_row = NULL
)

Arguments

data_item

item to be taken from data for row

data

separate dataset to use

data_filter

filter to apply to dataset

row_digits

digits for data item (overrides table as a whole)

na.rm

whether to remove NA before reporting median and quartiles

reference_level

a level of the variable to drop from display (only relevant for logical/factor/character variables)

include_reference

whether to include a row for the reference level of a factor (only relevant for logical/factor/character variables)

workspace

passed onto fisher.test

non_parametric

whether to use non-parametric tests

row_digits_default

digits where .column_type = "default"

row_digits_surv

digits where .column_type = "default" and .column_variable inherits Surv

row_digits_numeric

digits where .column_type = "numeric"

cat_out_of_row

whether percentages in categories should be calculated out of row rather than column

Details

This provides a generic row for first_table with the type of row determined from the class of the data. This allows a list of quos to be created and then used for both a standard first_table and one that uses a Surv column.

Value

row for inclusion in 'first_table'

Examples

library(survival)
first_table(lung,
  .column_variable = Surv(time, status),
  .options = list(include_n = TRUE, include_n_per_col = TRUE),
   `Meal calories` = first_table_row(meal.cal, row_digits = 2)
 )

NikNakk/tableone documentation built on March 22, 2022, 1:19 p.m.