event_combo_extract: Extract combination of events (pattern or part of it)

Description Usage Arguments Value Examples

View source: R/event_combo.R

Description

Extract combination of events (pattern or part of it)

Usage

1
event_combo_extract(calendar, event1, n_months, event2, output = "pattern")

Arguments

calendar

string(s) of calendar, months in original order (i.e. recent -> older)

event1

code(s) of the earlier/older event(s) of interest

n_months

number of months between events (numerical)

event2

code(s) of the later/recent event(s) of interest

output

chose if return "event1", "event2" or the whole "pattern" detected [default: "pattern"]

Value

the combination/pattern of interest

Examples

1
2
3
4
5
6
dat_calendar <- c("3300000BPP", "5000TPP111", "0123005670")
event_combo_extract(calendar = dat_calendar,
event1 = c("B", "T"), n_months = 6, event2 = c(1:9))
event_combo_extract(calendar = dat_calendar,
event1 = c("B", "T"), n_months = 6, event2 = c(1:9),
output = "event2")

trottieralex/DHScalendR documentation built on March 12, 2020, 3:05 a.m.