-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
94 lines (70 loc) · 3.15 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# uiothemes
<!-- badges: start -->
[![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)
<!-- badges: end -->
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")
```
<!-- You can install the released version of uiothemes from [CRAN](https://CRAN.R-project.org) with: -->
<!-- ``` r -->
<!-- install.packages("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**
<div style="text-align: center;">
```{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))
```
</div>
### 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")
```