[Wishlist] Support Mosaic Plots?
Hello,
Thank you for the great lightweight package.
I was wondering if there's any plans to also support base R mosaic plots? I know that spineplots are currently available, but mosaic plots can also be nice.
Thanks for the suggestion. Which other mosaic features did you think about here? Other splitting orders and/or directions - or residual-based shadings? Maybe you can provide an example of a plot you would like to be able to generate along with the tinyplot(...) syntax that you would find intuitive for it.
I think there's a couple approaches.
The simplest might be to just copy the way type_spineplot does things and pass it to mosaicplot. I think this should work?
Beyond that, it's been a bit too long since I last used mosaic plots intensively to answer your other questions, but I'll try to ask around. It'd be nice to do the same things as mosaic as in the vcd and vcdExtra with a uniform syntax and without loading those other packages, but it seems like mosaic also has quite a long list of potential arguments, so this seems like it'll require more thinking.
Exactly, this is the reason why I'm asking. Incorporating all functionality from mosaic() into tinyplot() would be a bit much.
Calling mosaicplot() inside tinyplot() would only work for a two-way table - but then it would have little additional merit beyond type_spineplot(), except maybe residual-based shadings. The interesting cases would be higher-order tables, though, and I don't have a good idea how to put these into tinyplot().
The one thing that still is on my to-do list, though, is incorporating by variables (beyond the facet = "by" case). I think this would already provide some support for mosaic-style graphics.
I wasn't aware of type_spineplot, but it looks interesting. The one thing I'd wish for most for this and for a possible type_mosaic would be residual-based shading. It was disappointing that ggmosaic doesn't handle this.
For nway > 2 dimensions, faceting seems like a reasonable compromise.
Oh, and still on my list for vcd is to have a way to draw points in the cells, whose number is ~ observed or expected frequency.
Thanks for your Feedback, Michael @friendly, very useful!
The thing that I'm concerned about is that faceted spine plots are always geared towards exploring conditional independence of y and x given facet/by. So I feel it would be inappropriate to employ other independence models for which other types of mosaic arrangements would be more natural.
Drawing additional elements in mosaic plots is also a good point. I think for vcd we should have an example somewhere. For spineplot() in base R we had discussed whether the returned table should have an attribute or something similar to persp which does the coordinate transformations. However, we never could decide on a good and easy-to-use interface for this. With the faceting in tinyplot this does not become easier. I do not have an idea for a good solution here.