Split from it's original thread; Interesting tidy eval use cases
Deliberately provocative question: Will tidyeval kill the tidyverse?
Here's my reasoning:
In prehistory, I would use base r to create and tune some data-processing code. I had to create a lot of variables to store intermediate results, sure, and the syntax was kinda messy and hard to read. But things weren't that bad. Then, I would often wrap this code in a function by replacing one or two hard-coded values with vars, wrap it in function(), and then use it, e.g., in the apply family. Intuitive, quick, easy, and, importantly, easy to teach. I might go so far as to say this is the zen of r: code -> function -> apply.
At the dawn of the tidyverse, thanks to Hadley, I now have a toolkit of powerful functions that transparently connect to everyday data-processing tasks, that pipe together seamlessly, and make it addictively easy to write clean, easy to read, easy to teach, data-processing code. Yay!
But now I want to wrap that code in a function so I can use it again. With the underscore versions, I can just use character vars. Simple enough. But those are now deprecated. So I turn to tidyeval, a HELLISH CONFUSING NIGHTMARE whose purpose is to solve programming problems, not data-processing problems. I've tried to learn it a couple of times and failed. But I'm not too motivated to learn it because I know that even if I do, I won't be able to teach it to my students. I already had one blow up at me that she didn't enter grad school in anthropology to learn programming.
So what do I find myself doing? If I have the slightest suspicion that I will need to turn some code into a function, I don't even bother using the tidyverse, I just go back to using base r. I find myself doing this more and more.
I keep hoping Hadley will come up with something like:
mytidyfun <- tidyfunction(df, arg1, arg2){
df %>%
select(arg1) %>%
filter(arg2)
}
No quosures, !!, !!!, or enquos.
But maybe I'm the only one who isn't smart enough to master tidyeval...
My two cents.
PS. I've learned a lot just by reading this thread.