Examples for 'rlang::dyn-dots'


Dynamic dots features

Aliases: dyn-dots tidy-dots doc_dots_dynamic :=

Keywords:

### ** Examples

f <- function(...) {
  out <- list2(...)
  rev(out)
}

# Trailing commas are ignored
f(this = "that", )
$this
[1] "that"
# Splice lists of arguments with `!!!`
x <- list(alpha = "first", omega = "last")
f(!!!x)
$omega
[1] "last"

$alpha
[1] "first"
# Inject a name using glue syntax
if (is_installed("glue")) {
  nm <- "key"
  f("{nm}" := "value")
  f("prefix_{nm}" := "value")
}
$prefix_key
[1] "value"

[Package rlang version 1.1.4 Index]