0

So I need one of the arguments to be a symbol and the usual !!enquo(column) works, but I also need to make a dplyr join latter in the code using the same column.

Is there a problem with this? The code works I just want to know if it is correct.

f <- function(hello){ 
  hello <- enquo(hello)
## something using !!hello
  as_string(ensym(hello)) # here I need hello as a string
                          # because of by = hello in inner_join
}

f(hej)
xhr489
  • 1,957
  • 13
  • 39
  • 1
    Can you try to make this question reproducible? – Ronak Shah Aug 30 '19 at 09:25
  • 5
    Just take `ensym()` at the start, and use that throughout. `enquo()` is for complex expressions, but if you're using `ensym()` later on then you're abandoning support for complex expressions. Also using `ensym()` late means you'll get a late failure if the input is not a simple name. – Lionel Henry Aug 30 '19 at 09:38

0 Answers0