withr::local_dir(withr::local_tempdir("test", .local_envir = .GlobalEnv))
# Create dir for the example in tmpdir
dir.create("example/demo_trial/adam", recursive = TRUE)
# Create a config file in the example folder
config <- system.file("config", "_connector.yml", package = "connector")
# Show the raw configuration file
readLines(config) |>
cat(sep = "\n")
# Connect to the datasources specified in it
cnts <- connect(config)
cnts
# Content of each connector
cnts$adam
cnts$sdtm
# Overwrite metadata informations
connect(config, metadata = list(extra_class = "my_class"))
# Connect only to the adam datasource
connect(config, datasource = "adam")
# Connect to several projects in a nested structure
config_nested <- system.file("config", "_nested_connector.yml", package = "connector")
readLines(config_nested) |>
cat(sep = "\n")
cnts_nested <- connect(config_nested)
cnts_nested
cnts_nested$study1
withr::deferred_run()
Run the code above in your browser using DataLab