Use this to search for a character string across every element in a source data list including the name, label and contents.

query_src_list(.src_list, .string)

Arguments

.src_list

A source list created using read_src_dir.

.string

string to search for (not case sensitive)

Examples

path <- system.file("example-sdtm", package = "mrgda")

src_list <- read_src_dir(path)
#>  Detected file type = 'xpt'
#> Reading in ae.xpt (6.88 KB)
#>  /opt/rpkgs/4.3/mrgda/example-sdtm/ae.xpt
#> Reading in ae.xpt (6.88 KB)

#> Reading in dm.xpt (3.76 KB)
#>  /opt/rpkgs/4.3/mrgda/example-sdtm/dm.xpt
#> Reading in dm.xpt (3.76 KB)

#> Reading in eg.xpt (14 KB)
#>  /opt/rpkgs/4.3/mrgda/example-sdtm/eg.xpt
#> Reading in eg.xpt (14 KB)

#> Reading in lb.xpt (24.24 KB)
#>  /opt/rpkgs/4.3/mrgda/example-sdtm/lb.xpt
#> Reading in lb.xpt (24.24 KB)

#> Reading in mh.xpt (5.12 KB)
#>  /opt/rpkgs/4.3/mrgda/example-sdtm/mh.xpt
#> Reading in mh.xpt (5.12 KB)

#> Reading in pe.xpt (12.8 KB)
#>  /opt/rpkgs/4.3/mrgda/example-sdtm/pe.xpt
#> Reading in pe.xpt (12.8 KB)

#> Reading in vs.xpt (14.08 KB)
#>  /opt/rpkgs/4.3/mrgda/example-sdtm/vs.xpt
#> Reading in vs.xpt (14.08 KB)

#> ┌ read_src_dir Summary ────────────────────────┐
#> │                                              │
#> │   Number of domains successfully loaded: 7   │
#> │   Number of domains that failed to load: 0   │
#> │                                              │
#> └──────────────────────────────────────────────┘

# Summarize source directory
query_src_list(src_list, .string = "RACE")
#> # A tibble: 2 × 3
#>   DOMAIN       COLUMNS                  MATCHING
#>   <chr>        <chr>                    <chr>   
#> 1 lb           LBORRES,LBSTRESC,LBSTNRC RACE    
#> 2 mrgda_labels COLUMN_NAME,COLUMN_LABEL RACE