heorTheme: Add heor theme to ggplot, David's version, TBC

Description Usage Arguments See Also Examples

View source: R/heorTheme.R

Description

This function adds updated heor styling done by David, not complete yet. TBD: make sure font dependencies are working correctly. At the moment, it requires to import a bunch of windows fonts through extrafonts library (will it come as a part of installation?), import takes a few minutes.

Usage

1
heorTheme(data.name, font, fontscale, colour.name)

Arguments

data.name

The dataset used in the plot

font

The name of the font you want to be used, e.g. font="Tahoma"

fontscale

The size of the font to be used in the plot

colour.name

The name of the variable that is going to be stratified by colours

See Also

Other themes: heor_style_minimal(), heor_style()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(line_plot)
line_plot$treatment <- as.character(line_plot$treatment)
line_plot$treatment <- factor(line_plot$treatment,levels=unique(line_plot$treatment))
ggplot() +
geom_line(data=line_plot,mapping=aes(x=time,y=hba1c,colour=treatment),linetype="solid",alpha=1.0,size=0.7) +
geom_hline(yintercept=c(8.0,9.0),colour="black",linetype="dashed",size=0.4) +
scale_x_continuous("Time (Years)",breaks=seq(0,40,5),limits=c(0,40),expand=c(0,0)) +
scale_y_continuous("HbA1c (%)",breaks=seq(6.5,10.0,0.5),limits=c(6.5,10.0),expand=c(0,0)) +
labs(title="Plot Title",
     subtitle="Plot Subtitle",
     caption="Example caption text",
     tag="A)") +
     heorTheme(line_plot,"Tahoma",1,"treatment")

Alik-V/heor documentation built on April 4, 2020, 9:38 p.m.