View source: R/df.to.hierarchy.R
df.to.hierarchy | R Documentation |
Creates a hierarchy in list format from an edge list data.frame.
df.to.hierarchy( ancestry.df, leaf.df, parent.column = "parent", child.column = "child", id.column = "id", value.column = "value" )
ancestry.df |
data.frame containing edge data for all parents/children. |
leaf.df |
data.frame containing values for nodes without children. |
parent.column |
Name of column in ancestry.df containing parent nodes. Defaults to "parent". |
child.column |
Name of column in ancestry.df containing child nodes. Defaults to "child". |
id.column |
Name of column in leaf.df containing node names. Defaults to "id". |
value.column |
Name of column in leaf.df containing leaf values. Defaults to "value". |
A list representation of the hierarchy, which can be converted to JSON representation with jsonlitetoJSON.
data(flare) df.to.hierarchy(flare$ancestry.df, flare$leaf.df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.