Builds a data frame with one row for every combination of the supplied
vectors (a full cross-join), for use as the expected argument to
apply_criteria(). This lets attrition be denominated against the units
that should exist (e.g. every participant who was invited) rather than
only the rows actually present in data – so a participant who never
appears in the raw data is still counted as failing the first step that
requires non-missing data, instead of being silently absent from the
denominator.
Arguments
- ...
Named vectors of values, one per grouping variable, e.g.
participant_id = 1:50, visit = c("baseline", "3mo", "6mo"). At least one named argument is required.- stringsAsFactors
Passed to
expand.grid(); defaultFALSE.
See also
Other pipeline:
apply_criteria(),
cf_hierarchy(),
continue_criteria()
Examples
cf_expected(participant_id = 1:3, visit = c("baseline", "3mo"))
#> # A tibble: 6 × 2
#> participant_id visit
#> <int> <chr>
#> 1 1 baseline
#> 2 2 baseline
#> 3 3 baseline
#> 4 1 3mo
#> 5 2 3mo
#> 6 3 3mo