Description Usage Arguments Value Examples
Determines presence of a specified condition in the self-reported family history data. If multiple history fields are provided (e.g. history of mother and father), presence of the condition in either field determines a positive family history.
1 2 3 4 5 6 7 | visit_family_history(
visit_data,
fields,
condition,
collapse = TRUE,
name = NULL
)
|
visit_data |
Data frame/table with UK Biobank data. |
fields |
Vector of family history fields to extract e.g. one or more
from |
condition |
Code for condition. Only a single condition at a time is currently supported. See https://biobank.ndph.ox.ac.uk/showcase/coding.cgi?id=1010 to identify condition codes. |
collapse |
Summarise results across all visit dates (default |
name |
Optional column name for condition (default |
Data table with TRUE
(condition was reported), FALSE
(condition was not reported) or NA
(unknown/no response).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
# Load data
data_path <- "" # add path to your data
visit <- fread(data_path)
# Extract history for father
visit_family_history(visit, 20107, 9)
# Extract history for father, mother and siblings
visit_family_history(visit, c(20107, 20110, 20111), 9)
# Name column in output
visit_family_history(visit, c(20107, 20110, 20111), 9, name = "diabetes")
# Get history reported at each visit date
visit_family_history(visit, c(20107, 20110, 20111), 9, collapse = FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.