filter_within_timeframe: Find and filter all events within a certain time of a...

View source: R/filter_within_timeframe.R

filter_within_timeframeR Documentation

Find and filter all events within a certain time of a specific event For example, find all events 5 seconds prior to and including a shot Right now only looks works for seconds before (lead), need to have a solution that looks after and between two times

Description

Find and filter all events within a certain time of a specific event For example, find all events 5 seconds prior to and including a shot Right now only looks works for seconds before (lead), need to have a solution that looks after and between two times

Usage

filter_within_timeframe(.data, condition, time, lead_time = 0, lag_time = 0)

Arguments

.data

The data frame

condition

The event to find in dplyr fashion. Such as event == 'A'

time

The column/data that contains the timestamp

lead_time

The number of seconds before the event occurs

lag_time

The number of seconds after an event occurs (needs to be implemented)

time_filter

The number of seconds before the event occurs

Value

A plot of a pitch


stxlen/soccr documentation built on Feb. 17, 2025, 1:23 a.m.