As sophisticated quantitative graphics become more commonplace in the mainstream media, I sometimes see charts on the Web that might have been created in R. I know the charts at pollster.com are done in R, and a correspondent (thanks, LA) suggests some in the Economist might have been done with R as well. The ones in the Economist aren't stock-standard R graphics, but R's graphics system is powerful enough that if you can design a chart, you can easily write a script to create it.
This
led me to the question: when you see a quantitative chart on the Web, is there any way to tell if it's done with R? Sadly, for the
JPG and
PNG graphics formats commonly seen on the web, the answer is no. Although the standards support the inclusion of metadata that might be used to identify R as the creator of the graphic, R's
jpg() and
png() drivers don't create any such identifying metadata. (Of course, as open-source software R could be modified to do so, but it doesn't today.) R doesn't create GIF files, so unless they've been converted from one of the formats that R does create, any GIF files you see aren't from R.
In the case of PDF and PostScript files, though, R does leave an identifying signature, which you can see by looking at the .ps or .pdf file in a text editor. PDF files contain the lines:
/Title (R Graphics Output)
/Producer (R 2.8.0)
/Creator (R)
(the Producer line depends on the version of R used), and PostScript files contain:
%%Title: R Graphics Output
%%Creator: R Software
It's possible to change the Title element with the
title= argument to
postscript() or
pdf(), but not many people do that. You can actually search for the default "R Graphics Output" title with an advanced Google search, which makes it easy to find sites that use R for PDF/PS graphs. (Here's the Google search that finds
PostScript and
PDF files with the default title.) Looking through the results, the usual suspects appeared (NOAA, EPA, journals, academic sites) but no big surprises -- but I'd expect most "mainstream" sites to be using PNG or JPG graphics, anyway.
Know of any other popular websites that use R to create graphics? Let us know in the comments.