Creates a Causal net, also known as Heuristics net. This is similar to a processmapR process map. However, the causal map deals with parallelism by trying to identifying causal dependencies between activities by using different heuristics as documented in dependency_matrix.

causal_net(
  eventlog = NULL,
  dependencies = dependency_matrix(eventlog = eventlog, threshold = threshold,
    threshold_frequency = threshold_frequency, ...),
  bindings = causal_bindings(eventlog, dependencies),
  threshold = 0.9,
  threshold_frequency = 0,
  type = causal_frequency("absolute"),
  sec = NULL,
  type_nodes = type,
  type_edges = type,
  sec_nodes = sec,
  sec_edges = sec,
  ...
)

Arguments

eventlog

The event log for which a causal map should be computed. Can be left NULL for more control if parameters dependencies and bindings are provided directly.

dependencies

A dependency matrix created for the event log, for example, by dependency_matrix.

bindings

Causal bindings created by causal_bindings.

threshold

The dependency threshold to be used when using the default dependency matrix computation.

threshold_frequency

The frequency threshold to be used when using the default dependency matrix computation.

type

A causal map type. For example, causal_frequency or causal_performance.

sec

A causal process map type. Values are shown between brackets.

type_nodes

A causal map type to be used for nodes only.

type_edges

A causal map type to be used for edges only.

sec_nodes

A secondary causal map type for nodes only.

sec_edges

A secondary causal map type for edges only.

...

Further parameters forwarded to the default dependency_matrix function.

Value

A DiagrammeR graph of the causal map.

Details

Warning: Projected frequencies are heuristically determined and counts may not add up.

Examples

# Causal map with default parameters
causal_net(L_heur_1)
#> Nodes
#> # A tibble: 7 × 12
#>   act   from_id     n n_dist…¹ bindi…² bindi…³ label color…⁴ shape fontc…⁵ color
#>   <chr>   <int> <dbl>    <dbl> <list>  <list>  <chr>   <dbl> <chr> <chr>   <chr>
#> 1 End         1    40       40 <list>  <list>  "End"      40 circ… brown4  brow…
#> 2 Start       2    40       40 <list>  <list>  "Sta…      40 circ… chartr… char…
#> 3 a           3    40       40 <list>  <list>  "a\n…      40 rect… white   black
#> 4 b           4    21       21 <list>  <list>  "b\n…      21 rect… black   black
#> 5 c           5    21       21 <list>  <list>  "c\n…      21 rect… black   black
#> 6 d           6    17       13 <list>  <list>  "d\n…      17 rect… black   black
#> 7 e           7    40       40 <list>  <list>  "e\n…      40 rect… white   black
#> # … with 1 more variable: tooltip <chr>, and abbreviated variable names
#> #   ¹​n_distinct_cases, ²​bindings_input, ³​bindings_output, ⁴​color_level,
#> #   ⁵​fontcolor
#> # ℹ Use `colnames()` to see all variable names
#> Edges
#> # A tibble: 8 × 8
#>   antecedent consequent   dep from_id to_id     n label penwidth
#>   <chr>      <chr>      <dbl>   <int> <int> <dbl> <chr>    <dbl>
#> 1 e          End        0.976       7     1    40 40         5  
#> 2 Start      a          0.976       2     3    40 40         5  
#> 3 a          b          0.917       3     4    21 21         3.1
#> 4 a          c          0.917       3     5    21 21         3.1
#> 5 a          d          0.929       3     6    13 13         2.3
#> 6 b          e          0.917       4     7    21 21         3.1
#> 7 c          e          0.917       5     7    21 21         3.1
#> 8 d          e          0.929       6     7    17 17         2.7

# Causal map with lower dependency treshold
causal_net(L_heur_1, threshold = .8)
#> Nodes
#> # A tibble: 7 × 12
#>   act   from_id     n n_dist…¹ bindi…² bindi…³ label color…⁴ shape fontc…⁵ color
#>   <chr>   <int> <dbl>    <dbl> <list>  <list>  <chr>   <dbl> <chr> <chr>   <chr>
#> 1 End         1    40       40 <list>  <list>  "End"      40 circ… brown4  brow…
#> 2 Start       2    40       40 <list>  <list>  "Sta…      40 circ… chartr… char…
#> 3 a           3    40       40 <list>  <list>  "a\n…      40 rect… white   black
#> 4 b           4    21       21 <list>  <list>  "b\n…      21 rect… black   black
#> 5 c           5    21       21 <list>  <list>  "c\n…      21 rect… black   black
#> 6 d           6    17       13 <list>  <list>  "d\n…      17 rect… black   black
#> 7 e           7    40       40 <list>  <list>  "e\n…      40 rect… white   black
#> # … with 1 more variable: tooltip <chr>, and abbreviated variable names
#> #   ¹​n_distinct_cases, ²​bindings_input, ³​bindings_output, ⁴​color_level,
#> #   ⁵​fontcolor
#> # ℹ Use `colnames()` to see all variable names
#> Edges
#> # A tibble: 10 × 8
#>    antecedent consequent   dep from_id to_id     n label penwidth
#>    <chr>      <chr>      <dbl>   <int> <int> <dbl> <chr>    <dbl>
#>  1 e          End        0.976       7     1    40 40         5  
#>  2 Start      a          0.976       2     3    40 40         5  
#>  3 a          b          0.917       3     4    21 21         3.1
#>  4 a          c          0.917       3     5    21 21         3.1
#>  5 a          d          0.929       3     6    13 13         2.3
#>  6 d          d          0.8         6     6     4 4          1.4
#>  7 a          e          0.833       3     7     5 5          1.5
#>  8 b          e          0.917       4     7    21 21         3.1
#>  9 c          e          0.917       5     7    21 21         3.1
#> 10 d          e          0.929       6     7    13 13         2.3

# For even more control omit the `eventlog` parameter
# and provide `dependencies` and `bindings` directly.
d <- dependency_matrix(L_heur_1, threshold = .8)
causal_net(dependencies = d,
           bindings = causal_bindings(L_heur_1, d, "nearest"))
#> Nodes
#> # A tibble: 7 × 12
#>   act   from_id     n n_dist…¹ bindi…² bindi…³ label color…⁴ shape fontc…⁵ color
#>   <chr>   <int> <dbl>    <dbl> <list>  <list>  <chr>   <dbl> <chr> <chr>   <chr>
#> 1 End         1    40       40 <list>  <list>  "End"      40 circ… brown4  brow…
#> 2 Start       2    40       40 <list>  <list>  "Sta…      40 circ… chartr… char…
#> 3 a           3    40       40 <list>  <list>  "a\n…      40 rect… white   black
#> 4 b           4    21       21 <list>  <list>  "b\n…      21 rect… black   black
#> 5 c           5    21       21 <list>  <list>  "c\n…      21 rect… black   black
#> 6 d           6    17       13 <list>  <list>  "d\n…      17 rect… black   black
#> 7 e           7    40       40 <list>  <list>  "e\n…      40 rect… white   black
#> # … with 1 more variable: tooltip <chr>, and abbreviated variable names
#> #   ¹​n_distinct_cases, ²​bindings_input, ³​bindings_output, ⁴​color_level,
#> #   ⁵​fontcolor
#> # ℹ Use `colnames()` to see all variable names
#> Edges
#> # A tibble: 10 × 8
#>    antecedent consequent   dep from_id to_id     n label penwidth
#>    <chr>      <chr>      <dbl>   <int> <int> <dbl> <chr>    <dbl>
#>  1 e          End        0.976       7     1    40 40         5  
#>  2 Start      a          0.976       2     3    40 40         5  
#>  3 a          b          0.917       3     4    21 21         3.1
#>  4 a          c          0.917       3     5    21 21         3.1
#>  5 a          d          0.929       3     6    13 13         2.3
#>  6 d          d          0.8         6     6     4 4          1.4
#>  7 a          e          0.833       3     7     5 5          1.5
#>  8 b          e          0.917       4     7    21 21         3.1
#>  9 c          e          0.917       5     7    21 21         3.1
#> 10 d          e          0.929       6     7    13 13         2.3

# The returned DiagrammeR object can be further augmented with
# panning and zooming before rendering:
# \donttest{
library(magrittr)
causal_net(L_heur_1) %>%
 render_causal_net(render = TRUE) %>%
 DiagrammeRsvg::export_svg() %>%
 svgPanZoom::svgPanZoom()
# }