combine_actions: Combine consecutive actions into a single action

Description Usage Arguments Value Examples

View source: R/seq_manipulation.R

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

1
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

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

ProcData documentation built on April 1, 2021, 5:07 p.m.