data.tree (version 0.7.0)

print.Node: Print a Node in a human-readable fashion.

Description

Print a Node in a human-readable fashion.

Usage

# S3 method for Node
print(x, ..., pruneMethod = c("simple", "dist", NULL),
  limit = 100)

Arguments

x

The Node

...

Node attributes to be printed. Can be either a character (i.e. the name of a Node field), a Node method, or a function taking a Node as a single argument. See Get for details on the meaning of attribute.

pruneMethod

The method used to prune for printing. If NULL, the entire tree is displayed. If "simple", then only the first limit nodes are displayed. If "dist", then Nodes are removed everywhere in the tree, according to their level.

limit

The maximum number of nodes to print. Can be NULL if the entire tree should be printed.

Examples

Run this code
# NOT RUN {
data(acme)
print(acme, "cost", "p")
print(acme, "cost", probability = "p")
print(acme, expectedCost = function(x) x$cost * x$p)
do.call(print, c(acme, acme$fieldsAll))

# }

Run the code above in your browser using DataCamp Workspace