select_helpers {gtsummary}R Documentation

Select helper functions

Description

Set of functions to supplement the {tidyselect} set of functions for selecting columns of data frames (and other items as well).

Usage

all_continuous(continuous2 = TRUE)

all_continuous2()

all_categorical(dichotomous = TRUE)

all_dichotomous()

all_tests(tests)

all_intercepts()

all_interaction()

all_contrasts(
  contrasts_type = c("treatment", "sum", "poly", "helmert", "other")
)

all_stat_cols(stat_0 = TRUE)

Arguments

continuous2

(scalar logical)
Logical indicating whether to include continuous2 variables. Default is TRUE

dichotomous

(scalar logical)
Logical indicating whether to include dichotomous variables. Default is TRUE

tests

(character)
character vector indicating the test type of the variables to select, e.g. select all variables being compared with "t.test".

contrasts_type

(character)
type of contrast to select. Select among contrast types c("treatment", "sum", "poly", "helmert", "other"). Default is all contrast types.

stat_0

(scalar logical)
When FALSE, will not select the "stat_0" column. Default is TRUE

Value

A character vector of column names selected

See Also

Review list, formula, and selector syntax used throughout gtsummary

Examples

select_ex1 <-
  trial |>
  select(age, response, grade) |>
  tbl_summary(
    statistic = all_continuous() ~ "{mean} ({sd})",
    type = all_dichotomous() ~ "categorical"
  )

[Package gtsummary version 2.0.0 Index]