R-NOLD 2012-05-23 05:48:00

May 23, 2012

(This article was first published on R-NOLD, and kindly contributed to R-bloggers)

Mapping Global Earthquake using XML and Maptools

Everyday the US Geological Survey (USGS) publish earthquake data (http://earthquake.usgs.gov/earthquakes/recenteqsww/Quakes/quakes_all.html) all over the globe. Using XML and maptool packages of R I downloaded and map USGS earthquake data using the following codes :


weq1 = readHTMLTable(usgseq, header=T, which=1,stringsAsFactors=F)
weq2 = readHTMLTable(usgseq, header=T, which=2,stringsAsFactors=F)
weq3= readHTMLTable(usgseq, header=T, which=3,stringsAsFactors=F)
weq4 = readHTMLTable(usgseq, header=T, which=4,stringsAsFactors=F)
weq5 = readHTMLTable(usgseq, header=T, which=5,stringsAsFactors=F)
weq6 = readHTMLTable(usgseq, header=T, which=6,stringsAsFactors=F)
weq7 = readHTMLTable(usgseq, header=T, which=7,stringsAsFactors=F)
weq8 = readHTMLTable(usgseq, header=T, which=8,stringsAsFactors=F)



plot(wrld_simpl, col=”green4″, border=”white”, axes=T)

plot(wrld_simpl, col=”green4″, border=”white”)
points(y~x, cex=(z^2)/12, col=ifelse(z>5,”red”,”blue”), pch=19)
text(0,101,”Global Earthquake Maps (May 15-23,2012)”, cex=1.8)
text(-180,-95,”Data Source: USGS\nCreated by: ARSalvacion”, adj=0, cex=0.5)

To leave a comment for the author, please follow the link and comment on their blog: R-NOLD.

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: , , ,

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)