This funciton leverages the lambda.r library to create Event types comprised of a list of quosures to make referencing data sources and elements easy with rlang::eval_tidy().

Arguments

data

(formula) A formula parsed as follows:

  • The LHS (if given) becomes the event label when argument label is not provided.

  • The RHS becomes a name or expression that returns the dataset when evaluated. If a pipe (`|`) is given after the data source name on the RHS, it is treated as an indication of an expression that will filter rows in the data when evaluated.

jk, start, end(string)

The name of the element in data denoting the 'join-key', 'start', and 'end' respectively.

label

A unique label for the event source

Value

A list comprised of the event label and three quosures (jk, time_start_idx, time_end_idx)

Examples

if (FALSE) { # \dontrun{
library(event.vectors)
Event(
  data = Event_B ~ subset(evs_src_03, join_key != 2)
  , jk = "join_key"
  , start = "date.start"
  , end = "date.end"
  )
Event(
  "World Peace" ~ evs_src_01 | date.start >= "2026-02-15"
  , "join_key", "date.start", "date.end"
  )
} # }