Skip to contents

When patterns are matched in variable names or labels, no subset is performed. When patterns are only matched in variable content, the data.frames are subset to rows where some variable matches the pattern.

Usage

cnt_search_result(
  search_result,
  n_distinct_vars = NULL,
  n_distinct_combined = TRUE,
  df_names = NULL,
  ignore_df_names = NULL,
  extra_vars = NULL,
  ignore_vars = NULL
)

Arguments

search_result

a search_result object obtained from search_environment_data.

n_distinct_vars

variables to count the unique values of.

n_distinct_combined

logical indicating whether to count the unique values of the combinations of n_distinct_vars.

df_names, ignore_df_names

optional character vectors of data.frame names to subset to/exclude.

extra_vars, ignore_vars

optional character vectors of variables to include/exclude in cnt results.

Value

a named list of cnt results.

Examples

data(dmcognigen_cov)
study_search <- search_environment_data(
  stringr::regex("study", ignore_case = TRUE)
)
cnt_search_result(
  study_search, 
  n_distinct_vars = c("USUBJID", "SUBJID"), 
  extra_vars = "ACTARM"
)
#> $dmcognigen_cov
#> # A tibble: 254 × 10
#>    STUDYID      RFXSTDTC   RFXENDTC   SITEID  DMDY ACTARM     n_USUBJID n_SUBJID
#>    <chr>        <chr>      <chr>      <chr>  <dbl> <chr>          <int>    <int>
#>  1 CDISCPILOT01 2012-07-09 2013-01-20 716       -3 Placebo            1        1
#>  2 CDISCPILOT01 2012-07-20 2013-01-11 703      -10 Xanomelin…         1        1
#>  3 CDISCPILOT01 2012-07-22 2013-01-20 701      -14 Xanomelin…         1        1
#>  4 CDISCPILOT01 2012-07-29 2013-02-10 711       -9 Placebo            1        1
#>  5 CDISCPILOT01 2012-07-31 2012-08-28 709      -10 Xanomelin…         1        1
#>  6 CDISCPILOT01 2012-08-05 2012-09-01 701      -14 Placebo            1        1
#>  7 CDISCPILOT01 2012-08-30 2012-11-04 704       -7 Placebo            1        1
#>  8 CDISCPILOT01 2012-09-02 2012-12-04 703      -11 Xanomelin…         1        1
#>  9 CDISCPILOT01 2012-09-07 2012-09-16 701      -13 Xanomelin…         1        1
#> 10 CDISCPILOT01 2012-09-07 2013-02-01 705       -5 Xanomelin…         1        1
#> # ℹ 244 more rows
#> # ℹ 2 more variables: n_USUBJID_SUBJID <int>, n <int>
#>