rename_nodes: Rename nodes.

Description Usage Arguments Value

View source: R/propose.R

Description

Changes the names of the nodes of a graph. Capable of giving new standard names to the inner nodes in a way that only depends on the graph topology (without the root) and the leaf names. This is necessary when detecting when graphs are identical up to inner node and admixture proportion names, see canonise_graph and remove_duplicates.

Usage

1
rename_nodes(graph, newnames = list())

Arguments

graph

The graph to be renamed.

newnames

A list of new names, given in the form list(old = "new"). Nodes not listed will keep their old name, unless no list is given at all, in which case the leaves keep their old names while the inner nodes get new standardised names.

Value

A graph with new node names.


mailund/admixture_graph documentation built on April 3, 2018, 9:28 p.m.