get_ukb_dummy | R Documentation |
Either read a dummy UK Biobank dataset into R or return the file path only.
get_ukb_dummy(file_name, path_only = FALSE)
file_name |
Name of dummy dataset file. |
path_only |
If |
The following dummy datasets are included with this package:
dummy_Data_Dictionary_Showcase.tsv
: A subset of fields from the UK
Biobank data dictionary (full version available from the UK Biobank data showcase website).
dummy_Codings.tsv
: A subset of UK Biobank data codings (full version
available from the UK Biobank data showcase website).
dummy_ukb_main.tsv
: A dummy main UK Biobank dataset. May be read into R
with read_ukb()
. Tidy clinical events fields with tidy_clinical_events()
.
dummy_gp_clinical.txt
: A dummy UK Biobank primary care clinical event
records dataset.
dummy_gp_scripts.txt
: A dummy UK Biobank primary care prescription
records dataset.
A data frame if path_only
is FALSE
(default) or a string if
path_only
is TRUE
.
library(magrittr)
# available dummy datasets
dummy_datasets <- c(
"dummy_Data_Dictionary_Showcase.tsv",
"dummy_Codings.tsv",
"dummy_ukb_main.tsv",
"dummy_gp_clinical.txt",
"dummy_gp_scripts.txt"
)
# read dummy dataset into R
get_ukb_dummy("dummy_ukb_main.tsv")
# get file path to dummy dataset
get_ukb_dummy("dummy_ukb_main.tsv", path_only = TRUE)
# read all available dummy dataset into R
dummy_datasets %>%
purrr::set_names() %>%
purrr::map(get_ukb_dummy, path_only = FALSE) %>%
purrr::map(tibble::as_tibble)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.