You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time I encounter a question like #3497, I wonder why ggplot2 doesn't have a Stat that simply applies a function by group. Though, in terms of the computational efficiency, it's generally better to have a summarised version of the data before entering ggplot2, it would be handy if we can summarise in ggplot2 especially when we generate plots one after another with different groupings.
I believe StatSummarycould have been implemented to be able to summarise data with other groupings than c("group", "x") because the code following seems very general one:
But, as the current make_summary_fun() expects a function that takes a vector, not a data.frame, it would be difficult to expand StatSummary to accept a function that summarises both x and y. So, to satisfy the need, I feel it might be nice to have some simple geom like below.
I don't see reasons why we shouldn't implement such a Stat. Am I missing something...?
I agree this makes some sense, and will be a good fallback for situations where the provides stats does t do exactly what the user need. One thing that complicated it all is in terms of documenting what kind of columns should get returned. This is quite dependent on the geom it gets coupled with and will require some knowledge on how ggplot2 works
Every time I encounter a question like #3497, I wonder why ggplot2 doesn't have a
Stat
that simply applies a function by group. Though, in terms of the computational efficiency, it's generally better to have a summarised version of the data before entering ggplot2, it would be handy if we can summarise in ggplot2 especially when we generate plots one after another with different groupings.I believe
StatSummary
could have been implemented to be able to summarise data with other groupings thanc("group", "x")
because the code following seems very general one:ggplot2/R/stat-summary.r
Lines 163 to 169 in b842024
But, as the current
make_summary_fun()
expects a function that takes a vector, not a data.frame, it would be difficult to expandStatSummary
to accept a function that summarises bothx
andy
. So, to satisfy the need, I feel it might be nice to have some simple geom like below.I don't see reasons why we shouldn't implement such a Stat. Am I missing something...?
Created on 2019-08-24 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: