op-colon-equals

0th

Percentile

Quoting assignment operator.

The colon-equals operator is typically used in DSL packages like ggvis and data.table. It is exported in rlang as a alias to ~. This makes it a quoting operator that can be shared between packages for computing on the language. Since it effectively creates formulas, it is immediately compatible with rlang's formulas and interpolation features.

Usage
":="()
is_colon_equals(x)
Arguments
x
An object to test.
Aliases
  • :=
  • is_colon_equals
  • op-colon-equals
Examples
# This is useful to provide an alternative way of specifying
# arguments in DSLs:
fn <- function(...) ..1
f <- fn(arg := foo(bar) + baz)

is_formula(f)
f_lhs(f)
f_rhs(f)

# A predicate is provided to distinguish formulas from the
# colon-equals operator:
is_colon_equals(a := b)
is_colon_equals(a ~ b)
Documentation reproduced from package rlang, version 0.0.0.9000, License: GPL-3

Community examples

Looks like there are no examples yet.