Learn R Programming

Tplyr (version 1.2.1)

pop_treat_var: Return or set pop_treat_var binding

Description

The treatment variable used in the target data may be different than the variable within the population dataset. set_pop_treat_var allows you to change this.

Usage

pop_treat_var(table)

set_pop_treat_var(table, pop_treat_var)

Value

For tplyr_pop_treat_var the pop_treat_var binding of the

tplyr_table object. For set_tplyr_pop_treat_var the modified object.

Arguments

table

A tplyr_table object

pop_treat_var

Variable containing treatment group assignments within the pop_data binding. Supply unquoted.

Examples

Run this code
tab <- tplyr_table(iris, Species)

pop_data(tab) <- mtcars
set_pop_treat_var(tab, mpg)

Run the code above in your browser using DataLab