The Heuristics miner algorithm is provided by the heuristicsmineR package.

library(bupaR)
library(heuristicsmineR)
library(petrinetR)
# Dependency graph / matrix
dependency_matrix(patients) %>% render_dependency_matrix()
# Causal graph / Heuristics net
causal_net(patients) %>% render_causal_net()

This discovers the Causal net of the built-in L_heur_1 event log that was proposed in the Process Mining book:

# Efficient precedence matrix
m <- precedence_matrix_absolute(L_heur_1)
as.matrix(m)
##           consequent
## antecedent  a  b  c  d  e End Start
##      a      0 11 11 13  5   0     0
##      b      0  0 10  0 11   0     0
##      c      0 10  0  0 11   0     0
##      d      0  0  0  4 13   0     0
##      e      0  0  0  0  0  39     0
##      End    0  0  0  0  0   0     0
##      Start 40  0  0  0  0   0     0
# Example from Process mining book
dependency_matrix(L_heur_1, threshold = .7) %>% render_dependency_matrix()
causal_net(L_heur_1, threshold = .7) %>% render_causal_net()

The Causal net can be converted to a Petri net (note that there are some unnecessary invisible transition that are not yet removed):

# Convert to Petri net
library(petrinetR)
cn <- causal_net(L_heur_1, threshold = .7)
pn <- as.petrinet(cn)
render_PN(pn)