Skip to contents

This function will read data a local path or default; useful for fileInput() object from Shiny

Usage

data_read(ui_data_source, ui_adam_data)

Arguments

ui_data_source

Source of the input data. Possible Values: "Local", "Default"

ui_adam_data

The data set name; when ui_data_source is "Default". When ui_data_source = "Local"; List containing 2 elements, $datapath (input file path) and $name (name of the file/dataset)

Value

a list containing 2 elements:

  • adam - input data read from the user location as data.frame

  • adam_attrib - data.frame with Variable Names and corresponding labels for adam

Examples

library(carver)
df <- data_read(ui_data_source = "Default", ui_adam_data = "ADSL")
dplyr::slice_head(df$adam$adsl, n = 10)
#> # A tibble: 10 × 48
#>    STUDYID     USUBJID SUBJID SITEID SITEGR1 ARM   TRT01P TRT01PN TRT01A TRT01AN
#>    <chr>       <chr>   <chr>  <chr>  <chr>   <chr> <chr>    <dbl> <chr>    <dbl>
#>  1 CDISCPILOT… 01-701… 1015   701    701     Plac… Place…       0 Place…       0
#>  2 CDISCPILOT… 01-701… 1023   701    701     Plac… Place…       0 Place…       0
#>  3 CDISCPILOT… 01-701… 1028   701    701     Xano… Xanom…      81 Xanom…      81
#>  4 CDISCPILOT… 01-701… 1033   701    701     Xano… Xanom…      54 Xanom…      54
#>  5 CDISCPILOT… 01-701… 1034   701    701     Xano… Xanom…      81 Xanom…      81
#>  6 CDISCPILOT… 01-701… 1047   701    701     Plac… Place…       0 Place…       0
#>  7 CDISCPILOT… 01-701… 1097   701    701     Xano… Xanom…      54 Xanom…      54
#>  8 CDISCPILOT… 01-701… 1111   701    701     Xano… Xanom…      54 Xanom…      54
#>  9 CDISCPILOT… 01-701… 1115   701    701     Xano… Xanom…      54 Xanom…      54
#> 10 CDISCPILOT… 01-701… 1118   701    701     Plac… Place…       0 Place…       0
#> # ℹ 38 more variables: TRTSDT <date>, TRTEDT <date>, TRTDUR <dbl>, AVGDD <dbl>,
#> #   CUMDOSE <dbl>, AGE <dbl>, AGEGR1 <chr>, AGEGR1N <dbl>, AGEU <chr>,
#> #   RACE <chr>, RACEN <dbl>, SEX <chr>, ETHNIC <chr>, SAFFL <chr>, ITTFL <chr>,
#> #   EFFFL <chr>, COMP8FL <chr>, COMP16FL <chr>, COMP24FL <chr>, DISCONFL <chr>,
#> #   DSRAEFL <chr>, DTHFL <chr>, BMIBL <dbl>, BMIBLGR1 <chr>, HEIGHTBL <dbl>,
#> #   WEIGHTBL <dbl>, EDUCLVL <dbl>, DISONSDT <date>, DURDIS <dbl>,
#> #   DURDSGR1 <chr>, VISIT1DT <date>, RFSTDTC <chr>, RFENDTC <chr>, …