A ggplot2 theme for the Milwaukee Journal Sentinel
See the examples/
folder for example graphics generated using the theme.
Add + theme_mjs()
to a ggplot2 chain of commands.
For example:
ggplot(mpg, aes(x = cty, y = hwy)) +
geom_point() +
ggtitle('Title', 'Subtitle') +
theme_mjs()
Install prequisites within the R console.
install.packages('devtools')
install.packages('roxygen2')
library(devtools)
library(roxygen2)
From the terminal, pull down this repo from github.
git pull https://github.com/datahub/ggmjs.git
Install ggmjs
in the R console.
setwd('[parent folder to ggmjs]')
install('ggmjs')
Note:
A more streamlined way of installing this package would be to use the install_github()
function from the devtools package. Because it is currently a private repo you would enter install_github('datahub/ggmjs', auth_token = PAT)
in the R console, where PAT is a personal access token generated here: https://github.com/settings/tokens. If this repo were made public then install_github('datahub/ggmjs')
alone would work.
Follow the instructions from the Install section.
Make changes to the code in the R/
folder. Add documentation to each exported function following roxygen2 conventions.
When you're done, compile the documentation. Run this in the R console.
setwd('./ggmjs')
document()
Reinstall the package following the instructions in the Install section and you'll be able to test the library.
See Hilary Parker's blog post on writing R packages for a bit more context.
Tips on editing ggplot themes: http://ggplot2.tidyverse.org/reference/theme.html