Learn R Programming

swaRmverse (version 0.1.0)

get_event_ids: Event Indexes

Description

This function returns a vector with the timeseries of event IDs according to the input keep column of the dataframe.

Usage

get_event_ids(df)

Value

a vector of the same length as the rows of the input dataframe with the timeseries of event IDs.

Arguments

df

A dataframe with a set and a keep column to get the timeseries of event IDs. The keep column is added by the define_events function and represents whether each timestep is part of an event or not (whether it should be kept in for the rest of the analysis). Each set of the dataframe should be ordered in time.

Author

Marina Papadopoulou m.papadopoulou.rug@gmail.com

See Also

define_events

Examples

Run this code
data <- data.frame(
set = c(rep('1', 50), rep('2', 50)),
keep = c(rep(FALSE, 10), rep(TRUE, 70), rep(FALSE, 20))
)
data$event <- get_event_ids(data)

Run the code above in your browser using DataLab