object.extract: Extract mathematical functions or variables

Description Usage Arguments Details Value Author(s) See Also

Description

The function extract mathematical functions or variables from a string which is usually the body of a function. If one wishes to extract directly from a function, such function must first be converted into a string. Another function in this package body2string does this.

Usage

1
object.extract(func, variable = TRUE, subset.q = TRUE, exception = NULL)

Arguments

func

A string. Although it is named as "func", this argument must be string-type. Function body2string converts an R function into a string.

variable

If TRUE, only mathematical variables in func will be extracted, otherwise mathematical functions will be extracted.

subset.q

If TRUE, the square bracket (usually used as subsetting) is recognised as part of the attached variable. E.g. x[a:b] will be recognised as one single variable while if FALSE, square brackets are ignored and three variables x,a,b are returned.

exception

String. Mathematical variables or functions not to be extracted. Can be a vector.

Details

NULL is returned if no variable or function in func.

Value

A list of string of variables or functions in func.

Author(s)

Char Leung

See Also

body2string


ComplexAnalysis documentation built on Jan. 15, 2017, 10:24 a.m.