r-lib / rlang

Low-level API for programming with R
https://rlang.r-lib.org
Other
508 stars 138 forks source link

Using functions like `compat_as_lazy()` in other packages? #253

Closed juliasilge closed 7 years ago

juliasilge commented 7 years ago

I want to be able to set up tidytext's functions to use rlang/tidyeval for its inputs and outputs. I notice that in tidyr, for example, there are whole unexported functions from rlang that are copied and put into that package, including functions like compat_as_lazy(). For getting started, I got the functions from rlang using :::, which of course causes a note in R CMD check.

What do you all think about this? If a package like tidytext needs functions like compat_as_lazy() or compat_lazy(), what do you think is the best way to go about it? Would you consider exporting these functions in the NAMESPACE?

lionel- commented 7 years ago

Since this is for deprecated functionality, we just copy the file in each package that needs the compatibility layer.

lionel- commented 7 years ago

Maybe we could export them in lazyeval or even in a new package? I'm not sure there would be much benefit as they should be mostly stable.

juliasilge commented 7 years ago

So your first inclination is that I just copy all the functions too?

lionel- commented 7 years ago

yes :)

juliasilge commented 7 years ago

OK! I am a NINJA when it comes to copy/paste.