Closed superkeyor closed 6 years ago
I don't think magrittr should have any package-specific workarounds.
Why not just use helpers, e.g.
qplotter <- function(data, ...) {
print(qplot(data=data, ...))
data
}
I think the real problem is that print.ggplot()
doesn't invisibly return its first argument.
The above seems to indicate that it is the data they want back for successively producing several plots... but still you're right that print.*
should return its argument.
There's also the problem with +
vs %>%
but that's out of scope.
Yeah, but one can always do gg %>% + geom_*
; although not fantastic...
it has been discussed here regarding plotting a ggplot object as a side effect: http://stackoverflow.com/questions/27264266/multiple-ggplots-with-magrittr-tee-operator
Is this possible? Thanks a lot!
guess %g>% has to be able to internally trigger a print() command in order to plot a ggplot object