Why I don't use ggplot2
simplystatistics.org
simplystatistics.org
For working data scientists in industry, there is an extremely important middle ground between exploratory plots that only I will ever see, and publication quality plots. The most important plots I make are those that I'll share with a small audience within my company. These need to be clear and aesthetically pleasing, but not polished to an extreme degree. Again, ggplot2 excels in this regime.
Python's seaborn has visualization capability that seems to compare well with ggplot2. Considerably more readable, IMO.
It's a beautifully polished and well-documented R package, but often I feel like I've wrestled a bear to get a figure just right. The effort though seems worth it for the results and I don't feel that way about the base graphics.
I'm on a mac too, and the scrolling is completely broken. It scrolls "page by page".
I hope you take the time to fix it. Since your article made it to the front page of HN I'm sure it must be a good article. But I don't have any way of reading it, which makes me very sad.
Please take the time to fix your scrolling issue.
The ggplot2 code is not formatted one-function-per-line like the base code. It may be slightly more LoC for base graphics, but it's very clear what is happening with the ggplot2 and design, which is a far more important attribute than LoC.
Once your graph reaches a certain level of complexity, though, or requires a certain degree of customization, I think base graphics regain the edge. At that point I prefer the level of control you get by drawing things from scratch with points(), lines(), text(), etc.
ggplot(melt(matrix), aes(x = Var1, y = Var2, fill = value)) + geom_raster()I like this article, because I think for production graphics, the author has a point. If you're placing lines, points, and labels on a screen — you can create anything. You can draw polygons and arcs. It's like drawing with raw SVG. But I'd have a hard time thinking of an exploratory data analysis situations I wouldn't reach for ggplot2 first. Since it looks at dataframe column types (integers, factors, numerics), it automatically matches these two the appropriate type of color gradient. Coloring a scatter plot by a potential confounder is one additional argument to aes(), e.g. aes(x, y, color=other_col). More than once during EDA I've done this and seen some horrifying pattern in data that shouldn't be there. That's a powerful tool for one extra function argument — the cost of checking for a confounder with color (or shape) is essentially near zero.
I'd make the case that this is a more costly operation in base graphics, and is thus much less likely to be done. You may already have your plots in a for loop to create panels, then you have a few extra lines for adjusting margins and axes (rather than facet_wrap(~col)). It took a lot of code to set that up — there's already a lot of cruft when you just need to do a quick inspection. Then you need to create a vector of appropriate size of colors, and then map this to data. Sure it's easy-ish, but it takes at least double the time as color=some_col. In EDA visualization, I want every single barrier to checking a confounder to be as small as possible—which is what ggplot2 does.
That said, I really liked this article because I do agree that going from EDA visualization to production is a hassle. Just after reading this, I remade some production ggplots with base graphics and love the simple aesthetic — which to mirror in ggplot takes a lot of hassle.
What I really long for is a lower-level data to visualization mapping (like d3) in R. d3 is a pain to learn, but it's really the only data abstraction (even though it is a low-level abstraction) that is seemingly limitless in what it does and can do. I always hope for a general data-join grammar like d3's to be the norm, built on top of base plotting (analogously: svg elements), and then have abstractions like ggplot for tabular data built on top of that.
[0] http://www.htmlwidgets.org/showcase_metricsgraphics.html
With great power comes terrible debugging!
Have you checked out rBokeh? Full browser interactivity, support for many more points than D3 (and way more if you turn on webGL), support for both server-based and serverless interactivity, all straight from R. http://hafen.github.io/rbokeh/