| graph_create | R Documentation |
Creates an interval or a stratigraphic graph.
graph_create(object, ...)
## S4 method for signature 'data.frame'
graph_create(
object,
type = c("interval", "stratigraphy"),
direction = c("above", "below"),
verbose = getOption("aion.verbose"),
...
)
## S4 method for signature 'matrix'
graph_create(
object,
type = c("interval", "stratigraphy"),
direction = c("above", "below"),
verbose = getOption("aion.verbose"),
...
)
## S4 method for signature 'TimeIntervals'
graph_create(
object,
type = c("interval", "stratigraphy"),
verbose = getOption("aion.verbose"),
...
)
object |
A |
... |
Currently not used. |
type |
A |
direction |
A |
verbose |
A |
intervalAn 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 (it must be a chordal graph).
stratigraphyA stratigraphic graph represents the directed relationships between temporal units (archaeological deposits), from the most recent to the oldest (Harris 1997). It can be formally defined as a directed acyclic graph (DAG), in which each vertex represents a layer and the edges represent stratigraphic relations.
An igraph graph object.
Experimental.
The igraph and relations packages need to be installed on your machine.
N. Frerebeau
Harris, Edward C., 1997. Principles of Archaeological Stratigraphy. Seconde edition. Academic Press.
Other graph tools:
graph_prune()
if (requireNamespace("igraph", quietly = TRUE) &&
requireNamespace("relations", quietly = TRUE)) {
## 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")
)
## Interval graph
g <- graph_create(int, type = "interval")
plot(g)
## Stratigraphic graph
g <- graph_create(int, type = "strati")
g <- graph_prune(g) # Remove redundant relations
plot(g, layout = igraph::layout_with_sugiyama)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.