RSurvey (version 0.9.3)

EvalFunction: Parse and Evaluate an RSurvey Expression

Description

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

Usage

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.

See Also

parse, eval

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataCamp Workspace