An open API service indexing awesome lists of open source software.

https://github.com/capro-uio/uiothemes

Package to download package source files, and for package dependencies, to port into TSD UIO
https://github.com/capro-uio/uiothemes

branding r uio

Last synced: 5 months ago
JSON representation

Package to download package source files, and for package dependencies, to port into TSD UIO

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# uiothemes

[![CRAN status](https://www.r-pkg.org/badges/version/uiothemes)](https://CRAN.R-project.org/package=uiothemes)
[![R build status](https://github.com/Athanasiamo/uiothemes/workflows/R-CMD-check/badge.svg)](https://github.com/Athanasiamo/uiothemes/actions)
[![Travis build status](https://travis-ci.com/Athanasiamo/uiothemes.svg?branch=master)](https://travis-ci.com/Athanasiamo/uiothemes)

The goal of uiothemes is to provide branded templates for the University of Oslo for commonly used R markdown packages.
Currently the package contains:

- Presentation template for the [xaringan](https://slides.yihui.org/xaringan/#1)-package
- Tutorial template for the [learnr](https://rstudio.github.io/learnr/)-package
- Website template for the [distill](https://rstudio.github.io/distill/website.html)-package
- Article template for the [distill](https://rstudio.github.io/distill/basics.html)-package
- Themes for the [ggplot2](https://ggplot2.tidyverse.org/)-package
- Colour and fill scales for the [ggplot2](https://ggplot2.tidyverse.org/)-package

## Installation
You can install uiothemes from github
```{r, eval = FALSE}
# install.packages("remotes")
remotes::install_github("Athanasiamo/uiothemes")
```

## Basic use

xaringan presentation, learnr tutorial and distill article templates with UiO branding can be access easily using the RStudio IDE, by selecting `File` -> `R markdown ...` -> `From Template`.

```{r, echo = FALSE, out.width="50%"}
knitr::include_graphics("man/figures/README-template.png")
```

Distill website template can be access most easily through the RStudio IDE to create a new project.
`File` -> `New project...` -> `New Directory` -> `UiO Distill Website`

```{r, echo = FALSE, out.width="50%"}
knitr::include_graphics("man/figures/README-project.png")
```

**Previews**


```{r, echo = FALSE, out.width="50%", fig.cap=c("Distill article", "Xaringan presentation", "Learnr tutorial", "Distill website")}
knitr::include_graphics(list.files("man/figures/", "preview", full.names = TRUE))
```

### ggplot2 branding

The ggplot branding is applied through themes and scales.

```{r, fig.retina=3}
library(uiothemes)
library(ggplot2)

ggplot(mtcars, aes(mpg, disp, colour = cyl)) +
geom_point(size = 5) +
scale_colour_uio(discrete = FALSE) +
theme_uio() +
labs(title = "The fonts and colours are UiO specific",
subtitle = "and can provide coherent plot branding")

ggplot(mtcars, aes(mpg, disp, colour = cyl)) +
geom_point(size = 5) +
scale_colour_uio(palette = "redwhite", discrete = FALSE) +
theme_uio_dark() +
labs(title = "The fonts and colours are UiO specific",
subtitle = "and can provide coherent plot branding")

```