event_count: Count number of occurences of the event

Description Usage Arguments Value Examples

View source: R/event_count.R

Description

Count number of occurences of the event

Usage

1
event_count(calendar, event, sequences = TRUE)

Arguments

calendar

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

event

code(s) of event of interest (can take regex)

sequences

look for sequence of event - if FALSE individual events [default: TRUE]

Value

number of time the event occured in the calendar string

Examples

1
2
3
dat_calendar <- c("3300000BPP", "5000TPP111", "0123005670")
event_count(dat_calendar, 0)
event_count(dat_calendar, "0", sequences = FALSE)

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