-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathprocess_matrix.Rmd
124 lines (84 loc) · 2.5 KB
/
process_matrix.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
title: "bupaR Docs | Process Matrix"
output:
html_document:
toc: false
---
```{r echo = F, out.width="25%", fig.align = "right"}
knitr::include_graphics("images/icons/matrix.PNG")
knitr::opts_chunk$set(fig.asp = 0.6,out.width = "80%")
```
***
# Process Matrix {.tabset .tabset-pills}
```{r include = F}
library(bupaverse)
```
```{r eval = F}
library(bupaverse)
```
A process matrix is a two-dimensional matrix showing the flows between activities. Its configuration is exactly the same as that used by `process_map()`, and can thus be the following:
* [`frequency()`](frequency_maps.html)
* Absolute frequency of flows
* Relative case frequency of flows
* Relative frequency of flows, for each antecedent
* I.e. given antecedent A, it is followed x% of the time by Consequent B
* Relative frequency of flows, for each consequent
* I.e. given consequent B, it is preceded x% of the time by Antecedent A
* [`performance()`](performance_maps.html)
* aggregation function x time unite x flow time type
The result of `process_matrix()` is is a data.frame with antecedent-consequent pairs, which can be visualized using `plot()`.
<style>
div.blue { background-color:#E6F4F1; border-radius: 5px; padding: 20px;}
</style>
## Frequency {.tabset .tabset-pills}
<div class = "blue">
### Absolute
```{r out.width = "100%"}
traffic_fines %>%
process_matrix(frequency("absolute"))
traffic_fines %>%
process_matrix(frequency("absolute")) %>%
plot()
```
### Relative-case
```{r}
traffic_fines %>%
process_matrix(frequency("relative-case"))
traffic_fines %>%
process_matrix(frequency("relative-case")) %>%
plot()
```
### Relative-antecedent
```{r}
traffic_fines %>%
process_matrix(frequency("relative-antecedent"))
traffic_fines %>%
process_matrix(frequency("relative-antecedent")) %>%
plot()
```
### Relative-consequent
```{r}
traffic_fines %>%
process_matrix(frequency("relative-consequent"))
traffic_fines %>%
process_matrix(frequency("relative-consequent")) %>%
plot()
```
</div>
## Performance
<div class = "blue">
```{r}
traffic_fines %>%
process_matrix(performance(FUN = mean, units = "weeks"))
traffic_fines %>%
process_matrix(performance(FUN = mean, units = "weeks")) %>%
plot()
```
</div>
# {.unnumbered .unlisted}
```{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')
```