Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

select_helpers

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).

  • all_continuous() selects continuous variables

  • all_categorical() selects categorical (including "dichotomous") variables

  • all_dichotomous() selects only type "dichotomous"

  • all_interaction() selects interaction terms from a regression model

  • all_intercepts() selects intercept terms from a regression model

  • all_contrasts() selects variables in regression model based on their type of contrast

Usage

all_continuous()

all_dichotomous()

all_categorical(dichotomous = TRUE)

all_interaction()

all_ran_pars()

all_ran_vals()

all_intercepts()

all_contrasts(contrasts_type = NULL)

Arguments

dichotomous

Logical indicating whether to include dichotomous variables. Default is TRUE

contrasts_type

type of contrast to select. When NULL, all variables with a contrast will be selected. Default is NULL. Select among contrast types c("treatment", "sum", "poly", "helmert", "other")

Value

A character vector of column names selected

Examples

glm(response ~ age * trt + grade, gtsummary::trial, family = binomial) %>%
  tidy_plus_plus(exponentiate = TRUE, include = all_categorical())

glm(response ~ age + trt + grade + stage,
    gtsummary::trial,
    family = binomial,
    contrasts = list(trt = contr.SAS, grade = contr.sum, stage = contr.poly)) %>%
tidy_plus_plus(exponentiate = TRUE,
               include = all_contrasts(c("treatment", "sum")))

broom.helpers

Helpers for Model Coefficients Tibbles

v1.3.0
GPL-3
Authors
Joseph Larmarange [aut, cre] (<https://orcid.org/0000-0001-7097-700X>), Daniel D. Sjoberg [aut] (<https://orcid.org/0000-0003-0862-2018>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.