Skip to contents

Returns trt_var when it is a column of df. Otherwise it returns the first configured candidate (see tlf_config()) present in the data, with a message. It errors when there is none.

Usage

tlf_resolve_trt(df, trt_var = "TRT01A", config = NULL)

Arguments

df

Data frame.

trt_var

Requested treatment/grouping column.

config

A tlf_config(); NULL resolves through tlf_get_config().

Value

A column name.

Examples

tlf_resolve_trt(ex_adsl, "TRTXX")
#> Using 'TRT01A' as the treatment variable ('TRTXX' not found).
#> [1] "TRT01A"