expand_conditions: Expand assignment conditions

View source: R/declare_potential_outcomes.R

expand_conditionsR Documentation

Expand assignment conditions

Description

Internal helper to eagerly build assignment conditions for potential outcomes.

Usage

expand_conditions(
  formula,
  conditions = c(0, 1),
  assignment_variables = "Z",
  data,
  level = NULL,
  label = NULL
)

Arguments

conditions

the conditions

assignment_variables

the name of assignment variables, if conditions is not already named.

Details

If conditions is a data.frame, it is returned unchanged

Otherwise, if conditions is a list, it is passed to expand.grid for expansion to a data.frame

Otherwise, if condition is something else, box it in a list with assignment_variables for names, and pass that to expand.grid.

Value

a data.frame of potential outcome conditions


DeclareDesign documentation built on Aug. 8, 2023, 5:13 p.m.