Examples for 'rlang::f_text'


Turn RHS of formula into a string or label

Aliases: f_text f_name f_label

Keywords:

### ** Examples

f <- ~ a + b + bc
f_text(f)
[1] "a + b + bc"
f_label(f)
[1] "`a + b + bc`"
# Names a quoted with ``
f_label(~ x)
[1] "`x`"
# Strings are encoded
f_label(~ "a\nb")
[1] "\"a\\nb\""
# Long expressions are collapsed
f_label(~ foo({
  1 + 2
  print(x)
}))
[1] "`foo(...)`"

[Package rlang version 1.1.4 Index]