Sequence input shared by the sequence verbs
Sequence input
Every verb that reads sequences reads them the same way:
- Long event table
a data.frame with one event per row.
actionnames the state column,actorthe column (or columns) that identify whose events they are,sessionthe column (or columns) that split an actor's events into sessions, andtimethe column that orders them: timestamps in any common date-time format, Unix times, or positions; row order whenNULL. A column namedaction,time,sessionorsession_id(in any case) is used when its argument isNULL;session = FALSEswitches the session detection off. Whentimeis given, a gap of more thantime_thresholdseconds between consecutive events starts a new sequence (default900, fifteen minutes);time_threshold = FALSEkeeps each actor or session in one sequence however long the gaps.timezoneis the time zone of timestamps that carry none (default"UTC"). Events with a missing actor or session raisehypergraphs_bad_input; a missing action stays in its sequence as a gap. Withoutactorall events form one sequence, announced by the messagehypergraphs_single_sequence.- Wide data.frame or character matrix
one sequence per row; trailing
NAs end a sequence.- List
one character vector per sequence.
- Model object
a
netobject,netobject_group,tnaorcograph_networkthat carries its sequence data.
These are the conventions of the tna family of packages, and the same call builds the same sequences there.
A missing state anywhere but at the end of a wide row is a gap. The
memory verbs (hon(), mogen(), hypa(), markov_order(),
memory(), hg_bootstrap(), hg_compare()) split a sequence at every
gap into its runs of observed states: no transition is counted across or
into a gap and no state "NA" is created (a state spelled "NA" is an
ordinary state). hg_bootstrap() and hg_compare() still resample the
original sequences, each with all its runs. Repeats are collapsed within
a run. State labels containing " -> " (the notation of memory nodes) are
refused with hypergraphs_bad_input by the verbs whose results name
paths.
A data.frame with columns named like an event table (code, state,
user, timestamp, ...) that is passed without action = and has no
action column raises hypergraphs_long_format (a
hypergraphs_bad_input): read as wide, its actor ids and times would
silently become states. actor, time or session without an action
column raises hypergraphs_bad_input.