as_graph: Interval Graph

as_graphR Documentation

Interval Graph

Description

Interval Graph

Usage

as_graph(object, ...)

## S4 method for signature 'TimeIntervals'
as_graph(object, aggregate = TRUE, ...)

Arguments

object

A TimeIntervals object.

...

Currently not used.

aggregate

A logical scalar: should disjoint intervals referring to the same event be aggregated?

Details

An interval graph is the graph showing intersecting intervals on a line. As time is linear and not circular, an interval graph contains no cycles with more than three edges and no shortcuts.

Value

An igraph graph object.

Author(s)

N. Frerebeau

See Also

Other chronological reasoning tools: overlap()

Examples

## Not run: 
## Seven intervals
int <- intervals(
  start = c(1, 2, 3, 6, 9, 13, 17),
  end = c(7, 4, 15, 14, 11, 18, 19),
  calendar = CE(),
  names = c("A", "B", "C", "D", "E", "F", "G")
)

## Do the intervals overlap?
overlap(int) > 0

## Interval graph
g <- as_graph(int)
plot(g)

## End(Not run)

aion documentation built on April 4, 2025, 1:53 a.m.