knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of ggois
is to make plots for in O&S style.
You can install ggois from github with:
# install.packages("devtools") devtools::install_github("brilstl/ggois")
This is a basic example of a plot with the theme_ois()
function:
library(ggois) library(tidyverse) # plot ---- diamonds %>% ggplot( aes(x = price, y = cut)) + geom_boxplot(colour = os_colours$red) + theme_ois()
ggois
also has some convenient functions for making tables and plots. The package is designed in a (generalized) linear algebra fashion (y ~ x
). This means that every functions includes the paramters data
, y
and x
. Some functions also allow for a moderator (y ~ x*z
). The packages has functions such as ggois_bar_chart
and ggois_likert_chart
, which create a summary tibble
. The summary tibble
inherits a class, by which the functions autoplot
and autotable
know how to interpret the data for plotting and creating tables. See examples below:
example_bar <- diamonds %>% ggois_bar_chart(cut, price) example_bar
example_bar %>% autoplot()
example_bar %>% autotable() %>% gt::as_raw_html()
example_likert <- diamonds %>% ggois_likert_chart(cut, clarity) example_likert
example_likert %>% autoplot()
example_likert %>% autotable() %>% gt::as_raw_html()
example_likert <- diamonds %>% filter(color %in% c("D", "E", "F")) %>% ggois_likert_chart(cut, clarity, color) example_likert
example_likert %>% autoplot()
example_likert %>% autotable() %>% gt::as_raw_html()
example_likert %>% autoplot(palette = c(os_colours$pink, "white", os_colours$red))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.