1

Say we have a function

my_fun <- function(...) {
  substitute(list(...))[-1] %>%
    sapply(deparse)
}

This behaves as expected:

> my_fun(iris, mtcars)
[1] "iris"   "mtcars"

But this does not:

> iris %>% my_fun(mtcars)
[1] "."      "mtcars"

How do I modify my function to take care of this?

Nate
  • 10,361
  • 3
  • 33
  • 40
kevinykuo
  • 4,600
  • 5
  • 23
  • 31

0 Answers0