Learn R Programming

gtsummary (version 0.1.0)

get_by_info: Simple utility function to get extract and calculate additional information about the 'by' variable in fmt_table1

Description

Given a dataset and the name of the 'by' variable, this function returns a data frame with unique levels of the by variable, the by variable ID, a character version of the levels, and the column name for each level in the fmt_table1 output data frame.

Usage

get_by_info(data, by)

Arguments

data

data frame

by

character name of the by variable found in data