Skip to contents

Converts the decision paths of a game run into a TraMineR::seqdef() object over the board-area alphabet, ready for sequence analysis. The alphabet is fixed to sdt_board_areas(), so sequences from different runs stay comparable even when a run never visits some area.

Usage

sdt_seqdef(run, replication = NULL)

Arguments

run

A game_run from sdt_simulate().

replication

Optional replication to restrict to. NULL keeps all, which is what you want when clustering across replications.

Value

A stslist object from TraMineR, carrying replication and casualty attributes recording where each row came from.

Examples

co <- sdt_synthetic_cohort(n = 12, seed = 1)
run <- sdt_simulate(sdt_scenario(co), replications = 2, seed = 1,
                    verbose = FALSE)
if (requireNamespace("TraMineR", quietly = TRUE)) {
  seqs <- sdt_seqdef(run)
  dim(seqs)
}
#> [1] 24  5