Skip to content

Instantly share code, notes, and snippets.

@ransford
Created July 16, 2012 12:26
Global earthquake map in 11 lines of R
library(maps)
library(ggplot2)
eqs7day.M1 <-
read.csv("http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M1.txt")
world = as.data.frame(map("world")[c("x","y")])
newmap <- qplot(x, y, data=world, geom="path",
xlab="Latitude", ylab="Longitude",
main=paste("Earthquakes", Sys.Date()-8, "to", Sys.Date()-1)) +
geom_point(data=eqs7day.M1,
aes(x=Lon, y=Lat, size=Magnitude,
colour=Depth))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment