Package: data.tree 1.1.0

data.tree: General Purpose Hierarchical Data Structure

Create tree structures from hierarchical data, and traverse the tree in various orders. Aggregate, cumulate, print, plot, convert to and from data.frame and more. Useful for decision trees, machine learning, finance, conversion from and to JSON, and many other applications.

Authors:Russ Hyde [ctb], Chris Hammill [ctb], Facundo Munoz [ctb], Markus Wamser [ctb], Pierre Formont [ctb], Kent Russel [ctb], Noam Ross [ctb], Duncan Garmonsway [ctb], Christoph Glur [aut, cre]

data.tree_1.1.0.tar.gz
data.tree_1.1.0.zip(r-4.5)data.tree_1.1.0.zip(r-4.4)data.tree_1.1.0.zip(r-4.3)
data.tree_1.1.0.tgz(r-4.4-any)data.tree_1.1.0.tgz(r-4.3-any)
data.tree_1.1.0.tar.gz(r-4.5-noble)data.tree_1.1.0.tar.gz(r-4.4-noble)
data.tree_1.1.0.tgz(r-4.4-emscripten)data.tree_1.1.0.tgz(r-4.3-emscripten)
data.tree.pdf |data.tree.html
data.tree/json (API)
NEWS

# Install 'data.tree' in R:
install.packages('data.tree', repos = c('https://gluc.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/gluc/data.tree/issues

Datasets:
  • acme - Sample Data: A Simple Company with Departments
  • mushroom - Sample Data: Data Used by the ID3 Vignette

On CRAN:

51 exports 206 stars 7.09 score 2 dependencies 75 dependents 10.6k downloads

Last updated 9 months agofrom:bee0d7618f

Exports:.parentSeparator.separatorAggregateAreNamesUniqueas.igraph.Nodeas.Nodeas.phylo.NodeaverageBranchingFactorClimbCloneCreateRandomTreeCreateRegularTreeCumulateDefaultPlotHeightDistanceDoFindNodeFormatFixedDecimalFormatPercentFromDataFrameNetworkFromDataFrameTableFromListExplicitFromListSimpleGetGetAttributeGetDefaultTooltipGetPhyloNrisLeafisNotLeafisNotRootisRootNavigateNodeNODE_RESERVED_NAMES_CONSTPruneRevertSetSetEdgeStyleSetFormatSetGraphStyleSetNodeStyleSortToDataFrameNetworkToDataFrameTableToDataFrameTreeToDataFrameTypeColToDiagrammeRGraphToListExplicitToListSimpleToNewickTraverse

Dependencies:R6stringi

data.tree sample applications

Rendered fromapplications.Rmdusingknitr::rmarkdownon Jul 09 2024.

Last update: 2023-11-12
Started: 2015-08-20

Introduction to data.tree

Rendered fromdata.tree.Rmdusingknitr::rmarkdownon Jul 09 2024.

Last update: 2023-11-12
Started: 2015-03-14

Readme and manuals

Help Manual

Help pageTopics
Sample Data: A Simple Company with Departmentsacme
Aggregate child values of a 'Node', recursively.Aggregate
Test whether all node names are unique.AreNamesUnique
Convert a 'data.tree' structure to a 'data.frame'as.data.frame.Node ToDataFrameNetwork ToDataFrameTable ToDataFrameTree ToDataFrameTypeCol
Convert a 'Node' to a 'dendrogram'as.dendrogram.Node
Convert a 'data.tree' structure to an igraph networkas.igraph.Node
Convert a 'data.tree' structure to a list-of-list structureas.list.Node ToListExplicit ToListSimple
Convert an object to a 'data.tree' data structureas.Node
Convert a a 'SplitNode' from the party package to a 'data.tree' structure.as.Node.BinaryTree
Convert a 'data.frame' to a 'data.tree' structureas.Node.data.frame FromDataFrameNetwork FromDataFrameTable
Convert a 'dendrogram' to a data.tree 'Node'as.Node.dendrogram
Convert a nested 'list' structure to a 'data.tree' structureas.Node.list FromListExplicit FromListSimple
Convert a a 'party' from the partykit package to a 'data.tree' structure.as.Node.party
Convert a 'phylo' object from the ape package to a 'Node'as.Node.phylo
Convert an 'rpart' object to a 'data.tree' structureas.Node.rpart
Convert a 'Node' to a phylo object from the ape package.as.phylo.Node
Calculate the average number of branches each non-leaf hasaverageBranchingFactor
Checks whether 'name' is a reserved word, as defined in 'NODE_RESERVED_NAMES_CONST'.CheckNameReservedWord
Climb a tree from parent to children, by provided criteria.Climb
Clone a tree (creates a deep copy)Clone
Create a tree for demo and testingCreateRandomTree
Create a tree for demo and testingCreateRegularTree
Cumulate values among siblingsCumulate
Calculates the height of a 'Node' given the height of the root.DefaultPlotHeight
Find the distance between two nodes of the same treeDistance
Executes a function on a set of nodesDo
Find a node by name in the (sub-)treeFindNode
Format a Number as a DecimalFormatFixedDecimal
Format a Number as a PercentageFormatPercent
Traverse a Tree and Collect ValuesGet
Get an attribute from a Node.GetAttribute
Determine the number a 'Node' has after conversion to a phylo objectGetPhyloNr
Check if a 'Node' is a leafisLeaf
Check if a 'Node' is not a leafisNotLeaf
Check if a 'Node' is not a rootisNotRoot
Check if a 'Node' is the rootisRoot
Sample Data: Data Used by the ID3 Vignettemushroom
Navigate to another node by relative path.Navigate
Create a 'data.tree' Structure With 'Nodes'Node
Names that are reserved by the Node class.NODE_RESERVED_NAMES_CONST
Plot a graph, or get a graphviz dot representation of the treeGetDefaultTooltip plot.Node SetEdgeStyle SetGraphStyle SetNodeStyle ToDiagrammeRGraph
Print a 'Node' in a human-readable fashion.print.Node
Prunes a tree.Prune
Reverts the sort order of a 'Node''s children.Revert
Traverse a Tree and Assign ValuesSet
Set a formatter function on a specific nodeSetFormat
Sort children of a 'Node' or an entire 'data.tree' structureSort
Write a 'data.tree' structure to Newick notationToNewick
Traverse a tree or a sub-treeTraverse