events {linbin} | R Documentation |
Event Tables
Description
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. |
... |
Additional arguments, either of the form |
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.
Value
An event table, the data.frame
object used by linbin
to describe interval data.
See Also
as_events
and read_events
for coercing objects and files to event tables, is_events
to validate event tables.
Examples
events(1, 5)
events(1:5)
events(c(0, 15, 25), c(10, 30, 35), x = 1, y = c('a', 'b', 'c'))