eval_content: evaluate content blocked within r code

Description Usage Arguments Details Value Examples

View source: R/render-utils.R

Description

helper function for evaluating code from text

Usage

1

Arguments

x

any R object

Details

use "'r mean(c(2,3))'" to specify evaluating the mean(c(2,3)). If this syntax is not used, the values are passed through unaltered.

Value

the return value from evaluating the function, or the raw input (unaltered) if there is no function to be evaluated.

Examples

1
2
3
eval_content("`r mean(c(2,3))`")
eval_content("`mean(c(2,3))`")
eval_content(list(c=3))

USGS-R/meddle documentation built on Nov. 21, 2020, 7:44 p.m.