Description Usage Arguments Value See Also Examples
View source: R/join_phecode_info.R
Takes a dataframe with a phecode column in it and desired new phecode
information columns to it: description
, category
, category_number
, and
phecode_index
(the relative position in ordered phenome of phecode).
1 2 3 4 5 | join_phecode_info(
data_w_phecode,
phecode_column = phecode,
cols_to_join = c("description", "category", "category_number", "phecode_index")
)
|
data_w_phecode |
Dataframe with a phecode column. |
phecode_column |
Unquoted column of passed data that contains phecodes |
cols_to_join |
Which columns of phecode info do you want appended to dataframe? |
input dataframe with three columns added to it.
get_phecode_info
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(dplyr)
data_w_phecode <- sample_n(phecode_descriptions, 100) %>%
select(phecode) %>%
mutate(random = rnorm(n()))
# Default values
data_w_phecode %>%
join_phecode_info()
# Can change name of phecode column
data_w_phecode %>%
rename(jd_code = phecode) %>%
join_phecode_info(jd_code)
# Can choose which columns are added
data_w_phecode %>%
join_phecode_info(cols_to_join = c("description", "phecode_index"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.