-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslides.Rmd
53 lines (39 loc) · 1.24 KB
/
slides.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
---
title: "Untitled"
author: "Julian Flowers"
date: "11/08/2017"
output: slidy_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(collapsibleTree)
library(readxl)
library(tidyverse)
```
## Work programme
```{r echo=FALSE, message=FALSE, warning=FALSE}
library(RColorBrewer)
phds_wp <- readxl::read_xlsx("work_area.xlsx")
catcolors <- brewer.pal(length(unique(phds_wp$Category)), "Reds")
typeColors <- phds_wp %>%
arrange(Category, Programme) %>%
group_by(Category) %>%
distinct(Programme) %>%
mutate(colors = colorspace::sequential_hcl(length(Programme))[seq_along(Programme)])
workcols <- phds_wp %>%
arrange(Category, Programme, `Work area`) %>%
group_by(Category) %>%
distinct(`Work area`) %>%
mutate(colors = colorspace::heat_hcl(length(`Work area`))[seq_along(`Work area`)])
phds_wp %>%
arrange(Category, Programme, `Work area`) %>%
collapsibleTree(
hierarchy = c("Category", "Programme", "Work area"),
root = "PHDS",
tooltip = TRUE,
fill = c("white",
catcolors,
typeColors$colors,
workcols$colors
))
```