R package for a ggplot2 resolved theme in line with the company house style
Installation can be done through devtools from the github repo directly. Please make sure that:
- You have an account on github with access permissions to beresolved
- You have created an access token for your account
- You have added that access token to your .Renviron through the GITHUB_PAT variable
For 3, use the usethis package. Then call
usethis::edit_r_environ()
and add: GITHUB_PAT= * YOUR_TOKEN_FROM_GITHUB * When this is done, simple use:
library(devtools)
devtools::install_github('beresolved/themeresolved',ref='v1')
Please note the ref setting. The code is not in the default master branch, but in the v1 branch.
To use the package:
library(themeresolved)
library(ggplot2)
theme_set(theme_resolved())
ggplot(iris,aes(x=Sepal.Width,y=Sepal.Length,color=Species))+geom_point()+facet_grid(Species~.)
All of your plots will be styled using this theme until you restart your R session.
By default, theme_resolved uses Lato and Oswald font families (Lato being the base family). Please ensure that:
- These fonts are properly installed on your system
- These fonts are known by R/Rstudio
To include the fonts in R/Rstudio, please use the extrafont package (and extrafontdb). For an excellent blog on how to do this have a look at this one.