theme_phewas: Phewas friendly theming for ggplot2

Description Usage Arguments Value Examples

View source: R/theme_phewas.R

Description

Turns off the plots attempt to write out each individual phecode name and ticks so plot renders faster and cleaner.

Usage

1
theme_phewas(phecode_on_x_axis = TRUE)

Arguments

phecode_on_x_axis

Is the phecode in the plot on the x axis?

Value

Ggplot2 theme object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(dplyr)
library(ggplot2)

data <- 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(data, aes(x = phecode, y = val, color = category)) +
  geom_point() +
  scale_color_phecode() +
  theme_phewas()


ggplot(data, aes(y = phecode, x = val, color = category)) +
  geom_point() +
  scale_color_phecode() +
  theme_phewas(phecode_on_x_axis = FALSE)

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