View source: R/lookups_and_mappings.R
all_lkps_maps_to_db | R Documentation |
Write the output from build_all_lkps_maps
to a SQLite database.
all_lkps_maps_to_db(
all_lkps_maps = build_all_lkps_maps(),
db_path = "all_lkps_maps.db",
overwrite = FALSE
)
all_lkps_maps |
A named list of look up and mapping tables, created
by |
db_path |
Where the database will be created. If an SQLite database file
already exists here, then the lookup and mapping tables will be added to
this. If |
overwrite |
If |
Returns db_path
invisibly
build_all_lkps_maps()
# build dummy all_lkps_maps resource (supressing warning messages)
all_lkps_maps_dummy <- build_all_lkps_maps_dummy()
# write to SQLite database file
db_path <- suppressMessages(
all_lkps_maps_to_db(
all_lkps_maps = all_lkps_maps_dummy,
db_path = tempfile()
)
)
# connect to SQLite database
con <- DBI::dbConnect(RSQLite::SQLite(), db_path)
# create named list of tbl_dbi objects
all_lkps_maps_dummy_db <- ukbwranglr::db_tables_to_list(con)
head(all_lkps_maps_dummy_db$icd10_lkp)
# import to R with dplyr::collect()
dplyr::collect(all_lkps_maps_dummy_db$icd10_lkp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.