Learn R Programming

rgp (version 0.4-1)

randchild: Select random childs or subtrees of an expression

Description

randchild returns a uniformly random direct child of an expression. randsubtree returns a uniformly random subtree of an expression. Note that this subtree must not be a direct child.

Usage

randchild(expr)
randsubtree(expr, subtreeprob = 0.1)

Arguments

expr
The expression to select random childs or subtrees from.
subtreeprob
The probability for randsubtree to select a certain subtree instead of searching further via an recursive call.