
Get the Dot code for a state transition graph
Source:R/get_state_transition_dot.R
get_state_transition_dot.RdGet the Dot code for a state transition graph
Arguments
- x
A state transition table as produced by a call to
get_state_transition_table().- labelFun
A function to apply to the edge labels in preprocessing.
- labelFunArgs
Arguments to specify to
labelFunin addition to the first argument (the edge weight, a number).
Examples
### 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);
#> Error in rock::parse_source(exampleFile): object 'notes' not found
### Show the state transition probabilities
exampleTable <- rock::get_state_transition_table(
parsedExample
);
#> Error: object 'parsedExample' not found
exampleStateDf <- rock::get_state_transition_df(
exampleTable
);
#> Error: object 'exampleTable' not found
exampleDotCode <- rock::get_state_transition_dot(
exampleStateDf
);
#> Error: object 'exampleStateDf' not found
DiagrammeR::grViz(exampleDotCode);
#> Error: object 'exampleDotCode' not found