Closed daranzolin closed 4 years ago
RStudio have implemented an adhoc behavior for magrittr's pipe, I'm not sure if I can leverage it for the naked pipe, it's probably hardcoded and I don't see them supporting the nakedpipe even when it's on CRAN :). I ll leave this open just in case but don't hold your breath! The thing that annoys me personally is that I get warning icons in the margin for wrong number of arguments, which you don't get with magrittr.
BTW thanks so much for the exposure on twitter, this really helps
Do you think it's worth filing an issue on the RStudio repo? There are numerous issues related to autocompletion.
Maybe but probably better once the package is on CRAN, for now I don't think it'll be taken seriously. Also I'm not sure what behavior I expect in a more general situation than the example you gave, so I'd need to define those expectations, I'm spending a few days without computer now, writing all this from my phone, I'll take a look when I'm back to geeking.
I think that what RStudio does is that when the lhs of a pipe chain is a symbol, and this symbol is bound to a list (incl data.frame), an environment, or a named vector, it will add these names to the autocompletion candidates.
In the example below we see that despite the changes being made to keep only the first column, all the columns are still present in the suggestions:
oddly enough the functions themselves didn't benefit from that :
closing for now to unclutter the issues as I have no leverage on this
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
I am still a convert to nakedpipe, but the one disadvantage I've experienced is the absence of column autocompletion within various tidyverse functions. For example, I get this from the pipe:
But nothing from nakedpipe:
As I tweeted, I'm still loving the coding experience and will continue using it. But the autocompletion would be amazing. Admittedly, I have no idea how it works behind the scenes.