Closed fsolt closed 8 years ago
Also see http://www.r-bloggers.com/ggextra-r-package-for-adding-marginal-histograms-to-ggplot2/ . The ggplot_build() function may be particularly helpful
per Berry, Golder, and Milton 2012 http://www.journals.uchicago.edu/doi/10.1017/S0022381612000199
see also http://polmeth.wustl.edu/files/polmeth/interaction_02_25_2016.pdf Very nice use of inset histograms, but not clear how they did it. Plus other comments on use of interactions that we should consider incorporating if possible. This showed up in my inbox while we were talking, btw.
here's the conversation on Twitter: https://twitter.com/fredericksolt/status/677554984792141824
I successfully replicated Jens, Mummolo, and Xu. The key looks to be draw the histogram FIRST. So, we may need a separate function from interplot.plot to draw such type of combined plot.
Commit your replication code to /dev? I'd like to look it over too.
Users can either use the model data or external source to superimpose the histogram.
http://rpubs.com/kohske/dual_axis_in_ggplot2 is a bit of a start