Skip to contents

strg_prune() removes redundant relations from a stratigraphic graph by computing its transitive reduction. The result is a 'pruned' graph that follows Harris' "Law of Stratigraphical Succession": that only the uppermost and undermost relations are significant when placing a unit in a stratigraphic sequence.

Usage

strg_prune(strg)

Arguments

strg

A stratigraph() object to prune.

Value

A stratigraph with redundant relations removed.

Examples


bushy_stratigraphy <- stratigraph(
  tibble::tibble(
    id = letters[1:5],
    above = list(NA, "a", "a", c("a", "b", "c"), c("a", "c", "d"))
  ),
  "id", "above"
)
#> Warning: Invalid stratigraphic graph:
#> ! Contains redundant relations
#>  Use `strg_prune()` to remove redundant relations

strg_prune(bushy_stratigraphy)
#> # A stratigraph: 5 units and 5 relations
#> # ✔ Valid stratigraphic graph
#>   a
#> ┌─┴─┐
#> b   c
#> └─┬─┘
#>   d
#>   
#>   e