EvalFunction: Parse and Evaluate an RSurvey Expression

Description Usage Arguments Value Author(s) See Also Examples

Description

This function parses and evaluates a character string representation of an RSurvey expression.

Usage

1
EvalFunction(txt, cols)

Arguments

txt

character. A string representation of an R function.

cols

list. See ManageVariables

Value

Returns the result of evaluating the text expression.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

parse, eval

Examples

1
2
3
4
5
6
7
8
d <- list(x = 1:10, y = 10:1)
Data("data.raw", d)
cols <- list()
cols[[1]] <- list(id = "X", index = 1, fun = "\"X\"")
cols[[2]] <- list(id = "Y", index = 2, fun = "\"Y\"")
EvalFunction("\"Y\"", cols)
EvalFunction("\"X\" + \"Y\"", cols)
EvalFunction("rnorm(12)", cols)

RSurvey documentation built on May 2, 2019, 3:28 p.m.