18 Jul 2013


This is a package that allows us to create R graphics in KML format in a manner that allows them to be displayed on Google Earth (or Google Maps). The idea is that we specify a geographical rectangular region to create an R graphics graphics device We then use regular R graphics commands to create plots. When we close the device, the KML content to render the R graphical elements is written to a file (or stored in an XML document).

Rendering plots on Google Earth via KML is different from putting an image as an overlay (possible via the RKML package). The individual graphical elements - lines, circles, rectangles, text, etc. - are rendered and accessible individually. We can toggle whether each element is displayed or not via the list in the Places control.

Many more things can be done to improve this device. It serves as a functional proof of concept. It is intended to allow people (myself and others) to experiment with using this medium to display statistical results.


  • Time series of San Francisco temperature Jan, 2004 - Feb, 2010
    The raw temperatures as a time series and a smoother time series in red.
  • boxplots.kmz
    This shows boxplots of temperature by month for each of three cities. There is a separate plot for each city, with 12 boxplots in each one. Each plot is in its own folder within the KML.

  • Duncan Temple Lang <duncan@wald.ucdavis.edu>
    Last modified: Wed Mar 3 05:59:52 PST 2010