evalb: Near 'eval(bquote(expr))' shortcut.

Description Usage Arguments Value Examples

View source: R/bquotefn.R

Description

Evaluate expr with bquote .() substitution. Including .(-x) promoting x's value from character to a name, which is called "quote negation" (hence the minus-sign).

Usage

1
evalb(expr, where = parent.frame())

Arguments

expr

expression to evaluate.

where

environment to work in.

Value

evaluated substituted expression.

Examples

1
2
3
4
5
6
if(requireNamespace('graphics', quietly = TRUE)) {
   angle = 1:10
   variable <- as.name("angle")
   fn_name <- 'sin'
   evalb(  plot(x = .(variable), y = .(-fn_name)(.(variable))) )
}

WinVector/wrapr documentation built on Nov. 21, 2020, 8:31 p.m.