crop_events: Crop Events

View source: R/event_operations.R

crop_eventsR Documentation

Crop Events

Description

Crops events to the specified intervals. Events are cut at interval endpoints and any whole or partial events lying outside the intervals are removed.

Usage

crop_events(e, crops, scaled.cols = NULL)

Arguments

e

An event table.

crops

An event table specifying the intervals for cropping. Point intervals are allowed, and will create new point events where they intersect the interior, but not the endpoints, of line events.

scaled.cols

Names or indices of the columns of the event table to be rescaled after cutting (see cut_events). Names are interpreted as regular expressions (regex) matching full column names.

See Also

cut_events for only cutting events.

Examples

e <- events(c(0, 10, 20), c(10, 20, 30), x = 10)
crop_events(e, events(c(0, 15)))
crop_events(e, events(c(0, 5, 15)))
crop_events(e, events(c(0, 5, 15)), scaled.cols = "x")
crop_events(e, events(c(0, 5, 5, 15)), scaled.cols = "x")   # creates new points inside lines
crop_events(e, events(c(0, 10, 10, 15)), scaled.cols = "x") # but not at line event endpoints

ezwelty/linbin documentation built on April 19, 2023, 8:41 a.m.