Guest User

Untitled

a guest
Oct 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. my.toggle <- function(toggle) {
  2. if (toggle) {
  3. print("yes")
  4. } else {
  5. print("no")
  6. }
  7. }
  8.  
  9. fn.args <- list(toggle = T)
  10. my.toggle(rlang::UQS(fn.args)) # fails
  11. # Error in if (toggle) { : argument is not interpretable as logical
  12.  
  13. rlang::quo(my.toggle(rlang::UQS(fn.args))) # but this is the right function call
  14. # <quosure: global>
  15. # ~my.toggle(toggle = TRUE)
Add Comment
Please, Sign In to add comment