is_events {linbin}R Documentation

Validate Event Table

Description

Tests whether the object meets the basic requirements of an event table, i.e. a data frame containing at least two numeric, finite columns named 'from' and 'to' ordered such that to > or = from on all rows.

Usage

is_events(x, verbose = FALSE)

Arguments

x

An R object.

verbose

Logical value indicating whether to print the reason for test failure.

See Also

events, as_events, and read_events for creating valid event tables.

Examples

verbose <- TRUE
is_events(c(1, 3), verbose)
is_events(data.frame(from = 1, t = 3), verbose)
is_events(data.frame(from = 1, from = 1, to = 3), verbose)
is_events(data.frame(from = 1, to = TRUE), verbose)
is_events(data.frame(from = 1, to = NA), verbose)
is_events(data.frame(from = 3, to = 1), verbose)
is_events(data.frame(from = 1, to = 3), verbose)   # TRUE

[Package linbin version 0.1.3 Index]