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.7-any)data.tree_1.1.0.zip(r-4.6-any)data.tree_1.1.0.zip(r-4.5-any)
data.tree_1.1.0.tgz(r-4.6-any)data.tree_1.1.0.tgz(r-4.5-any)
data.tree_1.1.0.tar.gz(r-4.7-any)data.tree_1.1.0.tar.gz(r-4.6-any)
data.tree_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
data.tree/json (API)

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

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:

Conda:

13.49 score 214 stars 127 packages 1.3k scripts 25k downloads 51 exports 2 dependencies

Last updated from:849d95ef9f. Checks:7 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develNOTE218
source / vignettesOK256
linux-releaseNOTE188
macos-releaseNOTE178
macos-oldrelNOTE172
windows-develNOTE126
windows-releaseNOTE105
windows-oldrelNOTE84
wasm-releaseOK147

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

Dependencies:R6stringi

data.tree sample applications
Introduction | World PopulationTreeMap (visualization) | Original Example, to be improved | Convert from data.frame | Aggregate and Cumulate | Prune | Plot | Plotting the treemap | Plot as dendrogram | Further developments | Portfolio Breakdown (finance) | Aggregate | Formatters | Print | ID3 (machine learning) | ID3 Introduction | Purity and Entropy | Information Gain | Training | Pseudo code | Implementation in R with the data.tree package | Training with data | Prediction | The prediction method | Using the prediction method | Jenny Lind (decision tree, plotting) | Load YAML file | Calculate | Plot with the data.tree plotting facility | Bubble Chart (visualization) | Load JSON file | File Explorer (system utilities) | Listviewer html widget | Gene Defect (genetics, probabilities, multi-generation models) | Algorithm | Analysis | Simulation | Parallelisation | Tic-Tac-Toe (game complexity) | Game play | Exit Criteria | Tree creation

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

Introduction to data.tree
Introduction | Trees | Trees in R | Trees in data.tree | data.tree basics | Definitions | Tree creation | Create a tree programmatically | Create a tree from a data.frame | Create a tree from a file | Node methods | Actives Examples (aka Properties) | OO-Style Methods Examples | Traditional R Methods | Climbing a tree (tree navigation) | Navigation by path | Navigation by position | Navigation by attributes | Custom attributes | Custom attributes in constructor | Custom attributes as function | Printing | Basic Printing | Formatters | Printing using Get | Plotting | plot | Styling | Other Visualisations | Dendrogram | igraph | networkD3 | Tree Conversion | Converting to data.frame | Converting to List of Lists | Converting to other objects | Tree Traversal | Get | Traversal order | Pre-Order | Post-Order | Ancestor | Filter and Prune | Attributes | Field | Method | Using recursion | Do | Set | Assigning values | Deleting attributes | Using Set and function assignment | Traverse and explicit traversal | Advanced Features | Aggregate | Cumulate | Clone | Sort | Prune | Performance Considerations | CPU | Memory

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