Not long ago, I published a post “Three ggplot2 Themes Optimized for the Web”, where I made some tweaks to my three favorite ggplot2 themes – theme_bw(), theme_classic(), and theme_void() – to make them more readable and generally look better in graphics posted online, particularly in blog posts and similar publications.
I was happy to see that some people liked those and suggested that I should make a package. I tended to view packages as large collections of code and functions, but as Sébastien Rochette wisely put it, “If you have one function, create a package! If this simplifies your life, why not?” And since I will be frequently using these themes in subsequent posts, I’d like to make it as convenient as possible for the reader to install and use them.
So here is the ggwebthemes package! It has the same three themes, which I have tweaked and improved some more.
The package is not yet on CRAN. You can install ggwebthemes from GitLab:
# option 1: install using devtools # install.packages("devtools") devtools::install_gitlab("peterbar/ggwebthemes") # option 2: install using remotes # install.packages("remotes") remotes::install_gitlab("peterbar/ggwebthemes") # load ggwebthemes library(ggwebthemes)
Please report bugs and/or submit feature requests here. Since I am currently using WordPress (but thinking about switching to a static site), I am particularly interested in how these themes would behave on Hugo and in blogs created with R Markdown/blogdown, so if you have any feedback, it will be most appreciated.
You can find the package’s reference manual here.
Note: To avoid confusing the readers, I will be removing the original post “Three ggplot2 Themes Optimized for the Web”, which contains early versions of these themes. You can still find it on R-Bloggers in case you need it.
The post ggwebthemes: Some ggplot2 Themes Optimized for Blogs appeared first on Data Enthusiast's Blog.