streval: A shortcut for evaluating an expression in a string format.

Description Usage Arguments Value See Also Examples

Description

To evaluate an expression such as "1+1", we need to apply two function iteratively. streaval() function is a simple wrapper around eval() and parse() functions.

Usage

1

Arguments

x

A character vector with a single element that contains an expression.

Value

Result of an evaluation of the expression contained in the string.

See Also

eval, parse

Examples

1
2
3
4
5
6
7
8
# create some expression
x <- "1+2"

# when evaluated it should produce 3
streval(x)

# streval() function has the same output as:
eval(parse(text=x))

hstojic/hfunk documentation built on May 17, 2019, 6:16 p.m.