-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathunite.Rmd
42 lines (29 loc) · 1.13 KB
/
unite.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
---
title: "bupaR Docs | Unite activities"
output:
html_document:
toc: false
---
```{r echo = F, out.width="25%", fig.align = "right"}
knitr::include_graphics("images/icons/aggregate.png")
```
***
# Unite activities
You can use `act_unite()` to remove unwanted differences between activities. For example, consider activities from the `sepsis` data set.
```{r}
sepsis %>%
activities()
```
We can replace all _Release X_ activities with a single unique _Release_ activity.
```{r}
sepsis %>%
act_unite(Release = c("Release A","Release B","Release C","Release D","Release E")) %>%
activities()
```
Note that, in contrast with `act_collapse()`, the number of activity instances will never be changed by `act_unite()`. Only the labels of existing activity instances will be changed. On the other hand `act_collapse()` merges multiple activity instances into a new instance.
```{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')
```