Skip to contents

Get the state transition data frame

Usage

get_state_transition_df(x)

Arguments

x

A state transition table as produced by a call to get_state_transition_table().

Value

A dataframe with columns fromState, toState, and nrOfTransitions.

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