combine_actions {ProcData}R Documentation

Combine consecutive actions into a single action

Description

Combine the action pattern described in old_actions into a single action new_action. The timestamp of the combined action can be the timestamp of the first action in the action pattern, the timestamp of the last action in the action pattern, or the average of the two timestamps.

Usage

combine_actions(seqs, old_actions, new_action, timestamp = "first")

Arguments

seqs

an object of class "proc"

old_actions

a character vector giving consecutive actions to be replaced.

new_action

a string giving the combined action

timestamp

"first", "last", or "avg", specifying how the timestamp of the combined action should be derived.

Value

an object of class "proc"

Examples

seqs <- seq_gen(100)
new_seqs <- combine_actions(seqs, 
                            old_actions=c("OPT1_3", "OPT2_2", "RUN"), 
                            new_action="KEY_ACTION")

[Package ProcData version 0.3.2 Index]