Learn R Programming

xegaDerivationTrees (version 1.0.0.6)

treeSize: Measures the number of symbols in a derivation tree.

Description

treeSize() returns the number of symbols in a derivation tree.

Usage

treeSize(tree)

Value

Integer. Number of symbols in a derivation tree.

Arguments

tree

Derivation tree.

See Also

Other Measures of Tree Attributes: treeLeaves(), treeListDepth(), treeNodes(), treeProbability()

Examples

Run this code
g<-compileBNF(booleanGrammar())
a<-randomDerivationTree(g$Start, g)
treeSize(a) 

Run the code above in your browser using DataLab