ggalt icon indicating copy to clipboard operation
ggalt copied to clipboard

geom_bag

Open benmarwick opened this issue 8 years ago • 3 comments

I wonder if you might be interested in the addition of a geom_bagplot to draw bagplots, which are a kind of bivariate boxplot. I've drafted a basic geom that can draw a convex hull around a given proportion of points. That takes care of the 'bag' (which typically encloses 50% of the points), and now I'm working on getting the 'fence' (which is a hull that excludes outliers). If I can work it out (or someone else can), do you think it would make a suitable addition to ggalt?

bagplot-kashiwar9-26-638

benmarwick avatar Mar 22 '16 14:03 benmarwick

Definitely open to it. Take a look at @bbolker's geom_encircle: https://github.com/hrbrmstr/ggalt/blob/master/R/geom_encircle.r (it may have solved some of the tech details).

hrbrmstr avatar Mar 22 '16 15:03 hrbrmstr

Righto, I've got a proof-of-concept and examples here: https://gist.github.com/benmarwick/00772ccea2dd0b0f1745 Some of the defaults might not yet be optimal, do let me know if you have any feedback.

benmarwick avatar Mar 23 '16 14:03 benmarwick

It is in DescTools (PlotBag) - https://cran.r-project.org/web/packages/DescTools/DescTools.pdf. Not a ggplot implementation however. BTW - PlotMiss with clust = T is also interesting.

ghost avatar Apr 08 '16 12:04 ghost