Skip to contents

Load Data Sets into a List

Usage

loadRawData(dataNames_char)

Arguments

dataNames_char

Names of data sets to load

Value

Loads data sets specified into the current function environment for further evaluation (unused) and then returns these data sets as a named list

Details

We may want to perform SQL-like operations on a set of tables without loading each table into R's Global Environment separately. This function loads these data sets into a self-destructing environment and then returns a named list of these data sets.

Examples

   loadRawData(c("tlfb", "all_drugs"))
#> $tlfb
#> # A tibble: 237,778 × 3
#>      who what     when
#>    <int> <fct>   <dbl>
#>  1     2 Opioid    -32
#>  2     2 Opioid    -31
#>  3     2 Alcohol   -30
#>  4     2 Opioid    -30
#>  5     2 Opioid    -29
#>  6     2 THC       -29
#>  7     2 Opioid    -28
#>  8     2 THC       -28
#>  9     2 Alcohol   -27
#> 10     2 Opioid    -27
#> # ℹ 237,768 more rows
#> 
#> $all_drugs
#> # A tibble: 307,523 × 4
#>      who what      source  when
#>    <int> <fct>     <fct>  <dbl>
#>  1     2 Morphine  TFB      -32
#>  2     2 Oxycodone TFB      -32
#>  3     2 Morphine  TFB      -31
#>  4     2 Oxycodone TFB      -31
#>  5     2 Alcohol   TFB      -30
#>  6     2 Morphine  TFB      -30
#>  7     2 Oxycodone TFB      -30
#>  8     2 Fentanyl  TFB      -29
#>  9     2 Oxycodone TFB      -29
#> 10     2 Thc       TFB      -29
#> # ℹ 307,513 more rows
#>