first_time_flag: Flags the first time and event occurs

View source: R/utilities.R

first_time_flagR Documentation

Flags the first time and event occurs

Description

Returns an indicator variable for the first time a condition is met in a dataframe. Useful for tagging when an event started or ended in a panel dataset.

Usage

first_time_flag(var, value)

Arguments

var

column name on which you wish to run funciton

value

value for which you are searching for first occurence


USAID-OHA-SI/COVIDutilities documentation built on Aug. 18, 2022, 2:28 a.m.