Description Usage Arguments See Also Examples
View source: R/event_operations.R
Crops events to the specified intervals. Events are cut at interval endpoints and any whole or partial events lying outside the intervals are removed.
1 | crop_events(e, crops, scaled.cols = NULL)
|
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
for only cutting events.
1 2 3 4 5 6 | 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
|
from to x
1 0 10 10
2 10 15 10
from to x
1 0 5 10
1.1 5 10 10
2 10 15 10
from to x
1 0 5 5
1.1 5 10 5
2 10 15 5
from to x
1 0 5 5
1.1 5 5 0
1.2 5 10 5
2 10 15 5
from to x
1 0 10 10
2 10 15 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.