Introduction

The function process_map can be used very easily to create a process map of an event log. Below, an example of a process map for the patients event log can be found.

library(bupaR)
patients %>%
    process_map()

Map profiles

Frequency profile

By default, the process map is annotated with frequencies of activities and flows. The is what is called the frequency profile, and can be created explicitly using the frequency function. This function has a value argument, which can be used to adjust the frequencies shown, for instance using relative frequencies instead of the default absolute ones.

patients %>%
    process_map(type = frequency("relative"))

Performance profile

Instead of a frequency profile, one can also use a performance profile, focussing on processing time of activities. The performance profile has two arguments: the FUN argument to specific the function to apply on the processing time (e.g. min, max, mean, median, etc.), and the units argument to specificy the time unit to be used.

patients %>%
    process_map(performance(median, "days"))

Simplifying process maps

When event logs get larger, they will also become more unstructured, making the process maps illegible and expensive to computate. In such cases, it is useful to apply them on a simplified version of the event log, using one or more of the subsetting method provided by edeaR.

Customizing Process Maps

The process_map function has a render argument, which, if set to FALSE, returns a raw dgr_graph from the DiagrammeR package, which can if needed be further customized, and subsequently rendered. For more information about DiagrammeR, please check their website

patients %>%
    process_map(render = F)
## $graph_info
##   graph_id     graph_name          graph_time     graph_tz write_backups
## 1 mTUSFIz1 graph_mTUSFIz1 2017-06-20 13:31:31 Europe/Paris         FALSE
## 
## $nodes_df
##   id type                       label nodes     shape          style
## 1  1 <NA>                       Start     0    circle rounded,filled
## 2  2 <NA>            Blood test (237)     1 rectangle rounded,filled
## 3  3 <NA>             Check-out (492)     2 rectangle rounded,filled
## 4  4 <NA>       Discuss Results (495)     3 rectangle rounded,filled
## 5  5 <NA>              MRI SCAN (236)     4 rectangle rounded,filled
## 6  6 <NA>          Registration (500)     5 rectangle rounded,filled
## 7  7 <NA> Triage and Assessment (500)     6 rectangle rounded,filled
## 8  8 <NA>                 X-Ray (261)     7 rectangle rounded,filled
## 9  9 <NA>                         End     8    circle rounded,filled
##   fontcolor color penwidth frequency   fillcolor fontname
## 1     green green      1.5      -Inf       green    Arial
## 2     white  grey      1.5       237 dodgerblue4    Arial
## 3     white  grey      1.5       492 dodgerblue4    Arial
## 4     white  grey      1.5       495 dodgerblue4    Arial
## 5     white  grey      1.5       236 dodgerblue4    Arial
## 6     white  grey      1.5       500 dodgerblue4    Arial
## 7     white  grey      1.5       500 dodgerblue4    Arial
## 8     white  grey      1.5       261 dodgerblue4    Arial
## 9       red   red      1.5       502         red    Arial
##                         tooltip fillcolor
## 1            Blood test\n (237)     white
## 2             Check-out\n (492)   #A6BDDB
## 3       Discuss Results\n (495)   #034E7B
## 4              MRI SCAN\n (236)   #034E7B
## 5          Registration\n (500)   #A6BDDB
## 6 Triage and Assessment\n (500)   #034E7B
## 7                 X-Ray\n (261)   #034E7B
## 8                         Start   #A6BDDB
## 9                           End     white
## 
## $edges_df
##    id from to  rel label color fontname arrowsize penwidth
## 1   1    2  9 <NA>     1  grey    Arial         1 1.000000
## 2   2    2  5 <NA>   236  grey    Arial         1 2.412826
## 3   3    3  9 <NA>   492  grey    Arial         1 3.951904
## 4   4    4  3 <NA>   492  grey    Arial         1 3.951904
## 5   5    4  9 <NA>     3  grey    Arial         1 1.012024
## 6   6    5  4 <NA>   236  grey    Arial         1 2.412826
## 7   7    6  7 <NA>   500  grey    Arial         1 4.000000
## 8   8    1  6 <NA>   500  grey    Arial         1 4.000000
## 9   9    7  2 <NA>   237  grey    Arial         1 2.418838
## 10 10    7  9 <NA>     2  grey    Arial         1 1.006012
## 11 11    7  8 <NA>   261  grey    Arial         1 2.563126
## 12 12    8  4 <NA>   259  grey    Arial         1 2.551102
## 13 13    8  9 <NA>     2  grey    Arial         1 1.006012
## 
## $global_attrs
##      attr value attr_type
## 1 rankdir    LR     graph
## 
## $directed
## [1] TRUE
## 
## $last_node
## [1] 9
## 
## $last_edge
## [1] 13
## 
## $node_selection
## [1] node
## <0 rows> (or 0-length row.names)
## 
## $edge_selection
## [1] edge from to  
## <0 rows> (or 0-length row.names)
## 
## $graph_log
##   version_id          function_used       time_modified    duration nodes
## 1          1           create_graph 2017-06-20 13:31:31 0.035022974     9
## 2          2 set_global_graph_attrs 2017-06-20 13:31:31 0.016011000     9
## 3          3    colorize_node_attrs 2017-06-20 13:31:31 0.003004074     9
##   edges
## 1    13
## 2    13
## 3    13
## 
## attr(,"class")
## [1] "dgr_graph"