Skip to contents

Add a new expression to a list (of expressions).

Usage

add_expr(expr_ls, new_expr)

Arguments

expr_ls

(list of call)
the list to which a new expression should be added.

new_expr

(call)
the new expression to add.

Value

a list of call.

Details

Offers a stricter control to add new expressions to an existing list. The list of expressions can be later used to generate a pipeline, for instance with pipe_expr.

Examples


lyt <- list()
lyt <- teal.modules.clinical:::add_expr(lyt, substitute(rtables::basic_table()))
lyt <- teal.modules.clinical:::add_expr(
  lyt, substitute(rtables::split_cols_by(var = arm), env = list(armcd = "ARMCD"))
)
lyt <- teal.modules.clinical:::add_expr(
  lyt,
  substitute(
    test_proportion_diff(
      vars = "rsp", method = "cmh", variables = list(strata = "strat")
    )
  )
)
lyt <- teal.modules.clinical:::add_expr(lyt, quote(rtables::build_table(df = dta)))
teal.modules.clinical:::pipe_expr(lyt)
#> rtables::basic_table() %>% rtables::split_cols_by(var = arm) %>% 
#>     test_proportion_diff(vars = "rsp", method = "cmh", variables = list(strata = "strat")) %>% 
#>     rtables::build_table(df = dta)