Japan Quake Map

October 31, 2011

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


Japan Quake Map

with R, ggplot2, and FFmpeg


1 Introduction

As a follow-up to ‘Analysis of Japanese Earthquakes Data’,
I sought to produce a map including infomation about epicenter and magnitude.
Last article have contributed to visualize the frequency of earthquakes,
on the other hand I have attempted to visualize infomation
about epicenter and magnitude on a map with R, ggplot2, and FFmpeg.

2 Data

The term of analysis data is from September 24, 2007 through October 26, 2011,
including “The 2011 off the Pacific coast of Tohoku Earthquake” on March 11, 2011.
The number of sample is 8692.
Data source is website of Japan Weather Association.

3 Result

The result can be seen at YouTube.
Please pay attention before and after “Tohoku Earthquake” on March 11, 2011 (1:03).

The images were rendered at 1920 × 1080 pixels, to allow the video to be seen in HD.
I recommend the “setting of 1080p” and “full screen” view.

jqm0959.png There was an omen of a severe earthquake two days before that.
But unhappily, we couldn’t make the best use of the bad omen.

4 Conclusion

After “Tohoku Earthquake”, many earthquakes have occured until today (October 2011).
More than 15,000 people confirmed died, more than 4000 people is still missing,
and there’re a lot of people who are victims.

If you kindly wish to send your donations, I’d like to introduce two website below.
First is Japanese Red Cross Society.
Second is Google Crisis Response.

Finally, I’d like to express our thanks to all of you for helping us.

5 Appendix

Sample code of R is as follows:

library (ggplot2)
library (mapproj)
library (maps)
library (maptools)

# setting parameter about a map.
long <- c (120, 150)
lat <- c (25, 50)

# Reading data of earthquakes and map.
url <- "http://knowledgediscovery.jp/data/eq39.csv"
eq <- read.csv(url, as.is=T)
map <- data.frame(map(xlim = long, ylim = lat))

# creating image with ggplot.
p <- ggplot(eq, aes(long, lat))
p + geom_path(aes (x, y), map) +
geom_point(aes(size = Magnitude, colour = Magnitude), alpha = 1/2) +
xlim(long) +

This analysis was assisted by “iAnalysis” which is statistics-based consulting firm in Japan.
URL: http://en.ianalysis.jp/ Logo.png

To leave a comment for the author, please follow the link and comment on their blog: Knowledge Discovery » R.

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...

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)