-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
45 lines (32 loc) · 1.23 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
---
output:
github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
# gguniversity
`gguniversity` provides additional themes and palettes for ggplot visualisations, based on branding from major UK universities.
Feel free to contact me with comments, suggestions or requests: <br />
LinkedIn: [@dougal-toms](https://www.linkedin.com/in/dougal-toms/)<br />
Twitter: [@DougalToms](https://www.twitter.com/DougalToms)
## Installation
`gguniversity` can be installed through GitHub
```{r, eval=F,message=F}
install.packages("devtools")
devtools::install_github("dougaltoms/gguniversity")
```
A corresponding colour palette with `n` number of colours can be generated for your `ggplot2` visualisations, using the `<university>_palette()` function:
```{r}
library(gguniversity)
library(scales)
exe_pal <- gguniversity::exeter_palette(16)
scales::show_col(exe_pal, ncol = 4, border=NA)
```
## Examples
```{r, message=FALSE}
library(ggplot2)
ggplot(iris, aes(x = Petal.Length, fill = Species)) +
geom_density(alpha = 0.8)+
scale_fill_manual(values=gguniversity::exeter_palette(3))+
labs(title="Petal length for three species of Iris", subtitle = "University of Exeter")+
gguniversity::theme_exeter()
```