Skip to contents

spec_grid() builds a tibble in which each row is one fully specified, defensible analysis. Every named argument is one analytic choice; the grid is the Cartesian product of all choices (via tidyr::expand_grid()), with a leading .spec_id column added.

Usage

spec_grid(...)

Arguments

...

Named analytic choices. Each value is a vector or list of the options for that choice, for example adjust_age = c(TRUE, FALSE).

Value

A tibble with one row per specification and a leading integer column .spec_id.

See also

adjuster_sets() for the common case of toggling covariates.

Examples

spec_grid(
  adjust_age = c(TRUE, FALSE),
  transform  = c("identity", "log"),
  missing    = c("complete", "impute")
)
#> # A tibble: 8 × 4
#>   .spec_id adjust_age transform missing 
#>      <int> <lgl>      <chr>     <chr>   
#> 1        1 TRUE       identity  complete
#> 2        2 TRUE       identity  impute  
#> 3        3 TRUE       log       complete
#> 4        4 TRUE       log       impute  
#> 5        5 FALSE      identity  complete
#> 6        6 FALSE      identity  impute  
#> 7        7 FALSE      log       complete
#> 8        8 FALSE      log       impute