I want to use qplot
(ggplot2) and then forward the data with magrittr
:
This works:
mtcars %>% qplot(mpg, cyl, data=.)
This produces an error:
mtcars %>% qplot(mpg, cyl, data=.) %>% summarise(mean(mpg))
And those produce only summary statistics:
mtcars %T>% qplot(mpg, cyl, data=.) %>% summarise(mean(mpg))
mtcars %>% {qplot(mpg, cyl, data=.); .} %>% summarise(mean(mpg))
mtcars %T>% {qplot(mpg, cyl, data=.)} %>% summarise(mean(mpg))
What is the problem? I already found this solution, but it does not help, as you see from the code attached.