Skip to contents

This utility extends the lookup table to include:

  • n_id the number of patients present in the dataset

  • rows_per_id the mean number of row per patient

  • crfname the actual name of the dataset

Usage

extend_lookup(
  lookup,
  ...,
  id_cols = get_subjid_cols(lookup),
  crf_cols = get_crfname_cols(lookup),
  datasets = get_datasets(lookup, envir = parent.frame())
)

Arguments

lookup

[data.frame(1)]
the lookup table

...

unused

id_cols, crf_cols

[character(n)]
for experts only

datasets

[data.frame(n)]
for experts only

Value

the lookup, extended

Examples

#tm = read_trialmaster("filename.zip", pw="xx")
tm = edc_example()
#> Warning: Option "edc_lookup" has been overwritten.
load_list(tm)
.lookup
#> ── Lookup table (extraction of 2024-01-01)  ────────────────────────────────────
#>   dataset     nrow  ncol
#>   <chr>      <dbl> <dbl>
#> 1 enrol         50     5
#> 2 db2           50     5
#> 3 db3           50     6
#> 4 short         50     4
#> 5 db1          100     6
#> 6 long_mixed   100     5
#> 7 long_pure    150     4
#> 8 ae           175     6
.lookup = extend_lookup(.lookup)
.lookup
#> ── Lookup table (extraction of 2024-01-01)  ────────────────────────────────────
#>   dataset     nrow  ncol  n_id rows_per_id crfname                 
#>   <chr>      <dbl> <dbl> <int>       <dbl> <chr>                   
#> 1 ae           175     6    48         3.6 Adverse events          
#> 2 long_pure    150     4    50         3   long data               
#> 3 db1          100     6    50         2   db1                     
#> 4 long_mixed   100     5    50         2   both short and long data
#> 5 enrol         50     5    50         1   enrol                   
#> 6 db2           50     5    50         1   db2                     
#> 7 db3           50     6    50         1   db3                     
#> 8 short         50     4    50         1   short data