layout_as_stemma: layout_as_stemma

Description Usage Arguments Details Value Warning Author(s) See Also Examples

View source: R/layout_as_stemma.R

Description

layout_as_stemma creates a tree-like layout from an edgelist, where nodes are placed horizontally according to a measure of distance from their parent node.

Usage

1

Arguments

x

an edgelist containing, as a third column, the distance between the two nodes.

Details

The distance between the nodes will usually correspond to the number of different readings (disagreements and omissions). If a node has several parents, the function will consider only the distance from the last parent in topological order.

Value

A layout, i.e. a matrix of two columns, giving x,y coordinates for each node.

Warning

This function is experimental. Horizontal overlapping may occur has a result.

Author(s)

Jean-Baptiste Camps

See Also

PCC.Stemma, PCC.reconstructModel.

Examples

1
2
3
4
5
6
7
8
edgelist = structure(
    c("{ABC}", "{ABC}", "{ABC}", "D", "A","A","G",
        "A", "B", "C", "E", "F","G","H",
        1,5,3,10,3,4,5), .Dim = c(7L, 3L)
  )
g = igraph::graph_from_edgelist(edgelist[,1:2], directed = TRUE)
layout = layout_as_stemma(edgelist)
plot(g, layout = layout)

stemmatology documentation built on May 2, 2019, 5:10 a.m.