View source: R/derived_variables.R
derive_dob | R Documentation |
Estimates dates of birth from year and month of birth (Field IDs 34 and 52 respectively) as the first date of the month.
derive_dob(
ukb_main,
ukb_data_dict = get_ukb_data_dict(),
.drop = FALSE,
.details_only = FALSE
)
ukb_main |
A UK Biobank main dataset. |
ukb_data_dict |
The UKB data dictionary (available online at the UK
Biobank
data
showcase. This should be a data frame where all columns are of type
|
.drop |
If |
.details_only |
If |
A data frame with a column called dob
(type
character).
ukb_main <- data.frame(eid = 1, f34_0_0 = 1990, f52_0_0 = 1)
# dummy UKB data dictionary
dummy_ukb_data_dict <- get_ukb_dummy("dummy_Data_Dictionary_Showcase.tsv")
# keep input year/month of birth columns
derive_dob(ukb_main,
ukb_data_dict = dummy_ukb_data_dict
)
# remove input year/month of birth columns
derive_dob(ukb_main,
ukb_data_dict = dummy_ukb_data_dict,
.drop = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.