Learn R Programming

rock (version 0.8.1)

get_state_transition_table: Get the state transition table

Description

Get the state transition table

Usage

get_state_transition_table(x, classIdentifier = "state")

Value

A table, with the 'from' states as rows and the 'to' states as columns

Arguments

x

A parsed source document as provided by parse_source().

classIdentifier

The identifier of the class that has the states to looks at.

Examples

Run this code
### 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
rock::get_state_transition_table(
  parsedExample
);

Run the code above in your browser using DataLab