scale_color_phecode: Phecode color scale for ggplot2

Description Usage Value Examples

View source: R/scale_color_phecode.R

Description

Phecode color scale for ggplot2

Usage

1

Value

ggplot2 color scale using category_colors() colors for each category.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)
library(ggplot2)

sample_n(phecode_descriptions, 300) %>%
  left_join(category_colors(return_df = TRUE) %>%
              mutate(bias = rnorm(n(), sd = 3)),
            by = 'category') %>%
  mutate(val = rnorm(n(), mean = bias)) %>%
  ggplot(aes(x = phecode, y = val, color = category)) +
  geom_point() +
  scale_color_phecode() +
  theme_phewas()

nstrayer/phewasHelper documentation built on April 2, 2020, 5:06 a.m.