4

I recently read the Non-standard evaluation chapter from the dplyr vignette, after I'd come across dplyr functions that end on _. Having heard an introduction into Haskell a long time ago, I roughly remember "lazy evaluation" as a term for "evaluation of code, but only if or when it is really necessary to do so" - and reading the lazy evaluation chapter form Hadley Wickham's Advanced R seemed to confirm that memory.

What I don't seem to be able to wrap my head around however is what NSE/SE (lazy/eager evaluation) is used for in dplyr and when e.g. functions like summarize_() are used in comparison to summarize().

Maybe I missed a part of documentation somewhere. I'd be happy to narrow down the topic of my question, or even roll back if it becomes clear that the question is too broad or has already been answered here.

maj
  • 2,479
  • 1
  • 19
  • 25
  • 2
    Do you remember where you first came across the `_` functions? Perhaps if you post an example, someone could explain why it's useful in that specific case. In general they're helpful when you're programming a function where one of your arguments needs to be passed into a function that has NSE. Here's a post I found that might help: http://stackoverflow.com/questions/27975124/pass-arguments-to-dplyr-functions/27975126#27975126 – GregF Aug 21 '15 at 17:04
  • Although expressed in a different way, the linked answer is in fact a duplicate. – Andrie Aug 24 '15 at 14:16

0 Answers0