Runs TDA's seq; against the sequence structure(s) given –
the same table TDA itself prints after defining them, listing each
structure's number of state variables, its time axis, and the
distinct states it actually contains.
Arguments
- sequences
a data frame or matrix, one row per case, one column per time point, in order – the same shape
tda_seqmtakes – or, givendatatoo, a character vector naming those columns within it directly, rather than requiring a separately pre-subsetted data frame: real sequence data typically carries an ID column and covariates alongside the states in the same data frame (TDA'sexamples/exam/seq.d4, e.g.), not only the states on their own. Fortda_seqev/tda_seqevd, also a list of several such specs, to define several independent sequence data structures at once – TDA'sseqdef(sn=1),seqdef(sn=2), ... – the pattern TDA's own manual uses to build a second sequence structure fromseq.d4'sS0..S5columns, entirely separate from the first (Y0..Y5), not a covariate of it. Usesn=to say which one a given call analyzes.- data
optional data frame
sequences(and, fortda_seqmd,covariates) name columns within, instead ofsequences/covariatesbeing the actual data already.- options
a named list of further TDA options, passed through.
- type
the sequence data type, TDA's
seqdefm=:1(default) one column per time point,2columns read as state/time pairs, one pair per spell.- dir
working directory.
- ...
passed to
tda_run.
Value
A data frame, one row per sequence structure: sn,
type, variables (number of time points),
tmin/tmax (the time axis), nstates, and
states (a list column, the actual state values, since their
count varies by structure).
See also
Other sequence analysis:
tda_evalfi(),
tda_fml(),
tda_frml(),
tda_seqgc(),
tda_seqm(),
tda_seqmd(),
tda_seqpe(),
tda_seqpm()
Examples
s <- data.frame(Y0 = c(1, 1, 2), Y1 = c(1, 2, 1), Y2 = c(2, 1, 1))
tda_seq_info(s)
#> sn type variables tmin tmax nstates states
#> 1 1 1 3 0 2 2 1, 2
# several structures at once, the same way tda_seqev's sn= does
d <- data.frame(Y0 = c(1, 1, 2), Y1 = c(1, 2, 1), S0 = c(1, 3, 1),
S1 = c(3, 1, 3))
tda_seq_info(list(c("Y0", "Y1"), c("S0", "S1")), data = d)
#> sn type variables tmin tmax nstates states
#> 1 1 1 2 0 1 2 1, 2
#> 2 2 1 2 0 1 2 1, 3