Substitute, deparse in dplyr::mutate
<p>There seems to be a difference as to where the following function is called from, but I am not getting it.</p>

<p>Calling this</p>

<pre><code>give_names = function(...) {
   sapply(substitute(list(...))[-1], deparse)
}
</code></pre>

<p>like that</p>

<pre><code>paste(give_names(var, sd), collapse = ", ")
#[1] "var, sd"
</code></pre>

<p>is very different from calling it like that:</p>

<pre><code>d = dplyr::mutate(data.frame(1), x = paste(give_names(var, sd), collapse = ","))
d[, "x"]
#[1] "c(\"function (x, y = NULL, na.rm = FALSE, use) \", \"{\", \"    if (missing(use
# (I truncated the output, its just function definitions but not names.)
</code></pre>

<p>Why does <code>mutate</code> return different results?</p>