ASTFunction: A specified function call as an ASTNode

ASTFunctionR Documentation

A specified function call as an ASTNode

Description

A specified function call as an ASTNode

A specified function call as an ASTNode

Format

R6Class object.

Super class

tangram::ASTNode -> ASTFunction

Public fields

r_expr

A string containing the raw r expression from inside the parenthesis

data

Data stored as a result of reduction

Methods

Public methods

Inherited methods

Method new()

Construct a node representing a function call

Usage
ASTFunction$new(value, r_expr)
Arguments
value

(character) The name of the function call

r_expr

Any r expression to be evaluated inside the call


Method factors()

Returns all terminal nodes, this is a terminal node so returns self

Usage
ASTFunction$factors()

Method name()

Returns the function call as character

Usage
ASTFunction$name()

Method string()

Returns a re-parsable representation of the node

Usage
ASTFunction$string()

Method reduce()

Given a data.frame execute the function in that environment and associate the result as data.

Usage
ASTFunction$reduce(data)
Arguments
data

(data.frame) The data.frame to use as the enviroment for the function execution


Method clone()

The objects of this class are cloneable with this method.

Usage
ASTFunction$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

ASTFunction$new("log", "x+2")$string()


spgarbet/tg documentation built on Feb. 21, 2023, 3:35 a.m.