Stratigraphy from an Edge List

## Usage

```
as_stratigraphy(x, y, ...)
# S4 method for character,character
as_stratigraphy(x, y, reduce = TRUE)
# S4 method for numeric,numeric
as_stratigraphy(x, y, reduce = TRUE)
# S4 method for list,missing
as_stratigraphy(x, reduce = TRUE)
# S4 method for matrix,missing
as_stratigraphy(x, reduce = TRUE)
```

## Arguments

- x, y
A

`character`

vector giving the names/IDs of the bottom and top layers (edge list), respectively (will be coerced to`character`

with`as.character()`

). If`y`

is missing,`x`

should be a two-columns observation table that records the stratigraphic relationships between younger contexts and older contexts.- ...
Currently not used.

- reduce
A

`logical`

scalar: should transitive reduction be performed?

## Value

A StratigraphicMatrix object.

## Details

A stratigraphic matrix represents directed relationships between stratigraphic units. A stratigraphic matrix is an adjacency matrix (a non symmetric square matrix with zeros on its main diagonal), suitable to build a directed acyclic graph (DAG).

## References

Dye, T. S. & Buck, C. E. (2015). Archaeological Sequence Diagrams and
Bayesian Chronological Models. *Journal of Archaeological Science*, 63:
84-93. doi:10.1016/j.jas.2015.08.008
.

## Examples

```
## Principles of Archaeological Stratigraphy, fig. 12
## Build an adjacency list
harris <- data.frame(
younger = c(1, 1, 1, 2, 3, 4, 5, 6, 6, 6, 7, 8, 1, 1),
older = c(2, 3, 4, 5, 5, 5, 6, 7, 8, 9, 9, 9, 7, 8)
)
## Coerce to adjacency matrix
strati <- as_stratigraphy(harris, reduce = TRUE)
## Define interface layers
set_interface(strati) <- c("1" = FALSE, "2" = TRUE, "3" = FALSE,
"4" = FALSE, "5" = FALSE, "6" = TRUE,
"7" = FALSE, "8" = FALSE, "9" = FALSE)
## Stratigraphic graph
graph <- as_graph(strati)
plot(graph)
```