as_graph | R Documentation |
Interval Graph
as_graph(object, ...)
## S4 method for signature 'TimeIntervals'
as_graph(object, aggregate = TRUE, ...)
object |
A |
... |
Currently not used. |
aggregate |
A |
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.
An igraph graph object.
N. Frerebeau
Other chronological reasoning tools:
overlap()
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.