New operator to control when to create a View() tab?
Closed this issue · 4 comments
@joachim-gassen what do you think about creating a special operator that controls when View()
is run? So when the user invokes the addin, rather than triggering View at the end of every pipe, the user can use an operator like this:
iris %>%
group_by(Species) %>% #no View
summarize_if(is.numeric, mean) %(V)% #create View
ungroup() %>% #no View
gather(measure, value, -Species) %(V)% create View
arrange(value) #create View
I like the general idea but personally, I think that the beauty of ViewPipeSteps lies in its simplicity. Mark code, start addin, done. As an oldtime unix guy I tend to be afraid of feature bloat, I guess.
This being said, I also do not fancy the views that are identical in display from others (like those created by group_by(), ungroup() and probably a few other commands.) Maybe we could incorporate a sort of identity test verifying that only unique views are displayed?
I gave it a quick try. Check my fork to see whether it makes sense to you. I also added the print option as discussed in #11.
Wow, yea, it works great! Probably wouldn't be a part of my workflow, but if we think other people would find it useful, go ahead and submit a PR!
Apologies for the delay and thank you for taking a quick look to see whether you still like it. Cheers!