Skip to contents

Deparse an expression and display the code following NEST conventions.

Usage

styled_expr(expr)

Arguments

expr

(call)
or possibly understood as so.

Note

The package prettycode must be installed to turn on colored output, hence the warning.

Examples

expr <- quote(
  rtables::basic_table() %>%
    rtables::split_cols_by(var = "ARMCD") %>%
    test_proportion_diff(
      vars = "rsp", method = "cmh", variables = list(strata = "strat")
    ) %>%
    rtables::build_table(df = dta)
)

teal.modules.clinical:::styled_expr(expr)
#> Warning: Could not use `colored = TRUE`, as the package prettycode is not installed.
#> Please install it if you want to see colored output or see
#> `?styler::print.vertical()` for more information.
#> rtables::basic_table() %>%
#>   rtables::split_cols_by(var = "ARMCD") %>%
#>   test_proportion_diff(vars = "rsp", method = "cmh", variables = list(strata = "strat")) %>%
#>   rtables::build_table(df = dta)