We’ve looked before at how you can annotate geographical maps using R, but what if you want to overlay data onto a globe of the Earth, using Google Earth? The RKML package for R (from the OmegaHat project) allows you to do just that, by providing a high-level interface from R to generate KML files, which in turn are used to drive animations in Google Earth.

Here’s one very cool example of its use: at the blog *Mind of a Markov Chain* you can find an animation of the Deepwater Horizon oil spill, overlaid with the tracks of tuna migrations. Here’s a screenshot:

Follow the link below for the animation, where you’ll see that the migration paths intersect with the spill (in both time and space). This animation was created with fewer than 30 lines of R code, which you can also find at the link.

Mind of a Markov Chain: R and Google Earth ~ comparing tuna tracks vs. Gulf of Mexico oil spill extent

*Related*

To

**leave a comment** for the author, please follow the link and comment on their blog:

** Revolutions**.

R-bloggers.com offers

**daily e-mail updates** about

R news and

tutorials on topics such as:

Data science,

Big Data, R jobs, visualization (

ggplot2,

Boxplots,

maps,

animation), programming (

RStudio,

Sweave,

LaTeX,

SQL,

Eclipse,

git,

hadoop,

Web Scraping) statistics (

regression,

PCA,

time series,

trading) and more...

If you got this far, why not

__subscribe for updates__ from the site? Choose your flavor:

e-mail,

twitter,

RSS, or

facebook...

**Tags:** applications, graphics, R