-
Notifications
You must be signed in to change notification settings - Fork 11
/
collapse.Rmd
52 lines (35 loc) · 1.07 KB
/
collapse.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: "bupaR Docs | Collapse Activities"
output:
html_document:
toc: false
---
```{r echo = F, out.width="25%", fig.align = "right"}
knitr::include_graphics("images/icons/aggregate.png")
```
***
# Collapse Activities
```{r include = F}
library(bupaverse)
knitr::opts_chunk$set(fig.height = 3)
```
```{r eval = F}
library(bupaverse)
```
Using `act_collapse()` you can replace a set of closely related activities by one higher-level activity. For example, consider the process map of `patients` data set.
```{r}
patients %>%
process_map()
```
Let's say we want to combine the activities _Blood test_, _MRI SCAN_ and _X-Ray_ scan into a single _Examination_ activity. This can be done as follows:
```{r}
patients %>%
act_collapse(Examination = c("Blood test","MRI SCAN","X-Ray")) %>%
process_map()
```
```{r footer, results = "asis", echo = F}
CURRENT_PAGE <- stringr::str_replace(knitr::current_input(), ".Rmd",".html")
res <- knitr::knit_expand("_button_footer.Rmd", quiet = TRUE)
res <- knitr::knit_child(text = unlist(res), quiet = TRUE)
cat(res, sep = '\n')
```