e: Mark a Label for Expression Evaluation

View source: R/format_create.R

eR Documentation

Mark a Label for Expression Evaluation

Description

Marks a format label string so it will be evaluated as an R expression at apply-time (fput), even when it does not contain .x1, .x2, etc. placeholders.

Usage

e(expr)

Arguments

expr

Character string. The R expression to evaluate.

Details

This is useful when a label should call a function that does not need positional .xN arguments. The expression is evaluated in the caller's environment of fput, so user-defined functions are accessible.

Labels containing .x1, .x2, etc. are still evaluated automatically without needing e().

Value

The same character string with an "eval" attribute set to TRUE.

Examples

# Mark an expression for evaluation at apply-time
fmt <- fnew(
  "timestamp" = e("format(Sys.time(), '%Y-%m-%d')"),
  "static"    = "Hello",
  name = "demo_eval"
)
fput(c("timestamp", "static"), fmt)
fclear()

ksformat documentation built on May 21, 2026, 9:07 a.m.