Creates an event table, a custom data.frame used throughout the linbin package to store and manipulate linearly referenced data. Each row includes an event's endpoints from and to (which can be equal, to describe a point, or non-equal, to describe a line) and the values of any variables measured on that interval.
Usage
events(from = numeric(), to = NULL, ...)
Arguments
from, to
Event endpoints, in any format coercible to single data frame columns. from and to are swapped as needed so that to > or = from on all rows. If from is the only non-empty argument, as_events is dispatched for object coercion.
...
Additional arguments, either of the form value or tag = value, to be passed directly to data.frame following from and to. Component names are created based on the tag (if present) or the deparsed argument itself.
Value
An event table, the data.frame object used by linbin to describe interval data.
Details
Event endpoints (and any additional arguments) are coerced to a data frame with data.frame, then coerced to an event table with as_events. A valid event table has two columns named "from" and "to" containing only finite numeric values (i.e., no NA, NaN, or Inf) and ordered such that to > or = from. is_events tests for these requirements. The other columns in the event table can be of any type supported by the data.frame class.