Site icon R-bloggers

Earthquakes

[This article was first published on Isomorphismes, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

> data(quakes) > head(quakes)

     lat   long depth mag stations

1 -20.42 181.62   562 4.8       41

2 -20.62 181.03   650 4.2       15

3 -26.00 184.10    42 5.4       43

4 -17.97 181.66   626 4.1       19

5 -20.42 181.96   649 4.0       11

6 -19.68 184.31   195 4.0       12

> summary(quakes)

      lat              long           depth            mag      

 Min.   :-38.59   Min.   :165.7   Min.   : 40.0   Min.   :4.00  

 1st Qu.:-23.47   1st Qu.:179.6   1st Qu.: 99.0   1st Qu.:4.30  

 Median :-20.30   Median :181.4   Median :247.0   Median :4.60  

 Mean   :-20.64   Mean   :179.5   Mean   :311.4   Mean   :4.62  

 3rd Qu.:-17.64   3rd Qu.:183.2   3rd Qu.:543.0   3rd Qu.:4.90  

 Max.   :-10.72   Max.   :188.1   Max.   :680.0   Max.   :6.40  

    stations     

 Min.   : 10.00  

 1st Qu.: 18.00  

 Median : 27.00  

 Mean   : 33.42  

 3rd Qu.: 42.00  

 Max.   :132.00  

> plot(quakes,     pch=20, col=rgb(0,0,0,.1) , lwd=.6) 

> require(ggplot2) > qplot(data = quakes, x = lat, y = long, size = exp(mag), color = mag, alpha = I(.8))

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

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.