A set of custom reusable plotting functions in R
install.packages("devtools")
library(devtools)
devtools::install_github("flaneuse/llamar")
library(llamar)
R has some wonderful packages that extend the functionality of base R. However, I get tired of loading the same libraries every time... so I created a bundler to do the work for me. To use, load llamar
and call loadPkgs
library(llamar)
loadPkgs()
The primary function of llamar is developing a set of custom, pre-defined clean themes, building off Hadley Wickham's awesome ggplot2 package.
All examples use the inbuilt mtcars dataset:
p = ggplot(mtcars, aes(x = mpg, y = wt, colour = cyl)) + geom_point() + ggtitle('title')
p + theme_basic()
p + theme_xygrid()
p + theme_xgrid()
p + theme_ygrid()
p + theme_blank()
p + theme_xaxis()
p + theme_yaxis()
p + theme_xylab()
p + theme_labelsOnly()