Description Usage Arguments Value See Also Examples
View source: R/get_phecode_info.R
Either grabs a vector of descriptions for passed vector of phecodes, or vector of categories, or a dataframe with both.
1 | get_phecode_info(codes, what = "description")
|
codes |
Vector of phecodes |
what |
What info should be returned. Options: |
Vector of what
is description or category, dataframe with phecode,
description, and category if what = 'all'
.
get_phecode_info
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(dplyr)
# Simulate some random data associated with phecodes
data_w_phecodes <- sample_n(phecode_descriptions, 100) %>%
select(code = phecode) %>%
mutate(random = rnorm(n()))
# Use function to add a column with description
data_w_phecodes %>%
mutate(descrip = get_phecode_info(code, 'description'))
# Use function to add column with category
data_w_phecodes %>%
mutate(category = get_phecode_info(code, 'category'))
# Use function to get dataframe of category and description that can be to join
# with data
bind_cols(
data_w_phecodes,
get_phecode_info(data_w_phecodes$code, 'all')
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.