ParseT: Parse text string.

Description Usage Arguments Value Note Examples

Description

Shorthand for parse(text = ...), frequently used with data.table This saves us from having to redo row selection in the env argument of EvalText().

Usage

1

Arguments

text

string to be sent as text argument to parse.

Value

the text as an expression, result of calling parse(text = text).

Note

Including outer eval() call in the shorthand caused errors, and needs to be done separately.

Examples

1
2
3
4
dt <- data.table::as.data.table(mtcars)
colname <- "mpg"
dt[1:5, eval(amss:::ParseT(colname))]
dt[, (amss:::PasteD(colname, "plus1")) := eval(amss:::ParseT(colname)) + 1]

google/amss documentation built on May 20, 2019, 5:05 p.m.