first_time: Find first or last time condition was met

Description Usage Arguments Details

View source: R/util.R

Description

This function is designed to be used as part of dplyr pipelines.

Usage

1
first_time(cond, time_col)

Arguments

cond

Condition to be evaluated

time_col

Unquoted column with timestamps

Details

This is often useful inside a grouped tibble / data.frame to calculate the first or last occurence of something per group.


lukerobert/luketools documentation built on Jan. 24, 2020, 2:15 a.m.