Question Details

No question body available.

Tags

r rlang tidyeval nse

Answers (1)

February 13, 2026 Score: 1 Rep: 34,518 Quality: Medium Completeness: 80%

Not entirely sure about your use case, but we can use match.call() to capture the raw call, so cl$arg2 is NULL (not a quosure object), and then using rlang::%||% to select the argument with a value.

library(rlang)

fx Mazda RX4 Wag 21.0 #> Datsun 710 22.8 #> Hornet 4 Drive 21.4 #> Hornet Sportabout 18.7 #> Valiant 18.1 fx(arg2 = mpg) #> mpg #> Mazda RX4 21.0 #> Mazda RX4 Wag 21.0 #> Datsun 710 22.8 #> Hornet 4 Drive 21.4 #> Hornet Sportabout 18.7 #> Valiant 18.1

Created on 2026-02-13 with reprex v2.1.1