knitr::opts_chunk$set( warning = FALSE, collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Additional Themes and Theme Components for ‘ggplot2’ along with additional utility functions for the Center On Rural Innovation.
The coriplot
package is a dedicated visualization toolkit designed specifically for the Center On Rural Innovation. The package extends ggplot2 with customized themes that are in accordance with the CORI Branding Guidelines with the aim of seamless standardization across multiple visuals. Additionally, the package sees added support for a set of utility tools to be used by CORI such as adding thresholds with/without annotations, adding watermarks, and more.
A comprehensive set of examples is available in the Getting Started section of this website.
You can install the development version of coriplot from GitHub with:
# install.packages("devtools") devtools::install_github("Dashansh/coriplot")
This is a basic example which shows you how to solve a common problem. We plot a single line showing the percentage of remotely working users with education equal to a bachelors degree or higher.
library(ggplot2) library(dplyr) library(coriplot) data(time_series_sample_data) data(remote_work_by_ed_level) data(remote_work_by_ed_level_2021)
theme_set(theme_grey()) # Extract the 2021 data # For Single line chart, let's focus on Bachelors or Higher Education level remote_work_by_ed_level_2021 %>% filter(education_level == "Bachelors or higher") %>% ggplot(aes(as.Date(date), pct_working_remotely)) + geom_line() + geom_point() + scale_x_date(date_breaks = "1 month", date_labels = "%b") + scale_y_continuous(limits = c(NA, 0.51)) + scale_y_percent() + labs( title = "Trend of working remotely throughout 2021", subtitle = "A single line chart example for education bachelors or higher", caption = "Source: https://www.placeholder.com") + xlab("2021") + ylab("Percentage %") -> fig
set_cori_geom_defaults() fig+theme_cori()
This same graph without the CORI theme to highlight the cori theme customisations.
fig
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.