### Get path to example source
examplePath <-
system.file("extdata", package="rock");
### Get a path to one example file
exampleFile <-
file.path(examplePath, "state-example-1.rock");
### Parse single example source
parsedExample <- rock::parse_source(exampleFile);
### Show the state transition probabilities
exampleTable <- rock::get_state_transition_table(
parsedExample
);
exampleStateDf <- rock::get_state_transition_df(
exampleTable
);
exampleDotCode <- rock::get_state_transition_dot(
exampleStateDf
);
DiagrammeR::grViz(exampleDotCode);
Run the code above in your browser using DataLab