2014年9月30日:過去30日間に発生した地震に関する各種ヒストグラム-世界全体および日本の状況について


Data Source:U.S. Geological Survey http://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php

Sys.time()
## [1] "2014-09-30 14:53:59 JST"

Package

library(xts) # http://cran.r-project.org/web/packages/xts/xts.pdf
library(ggplot2) # http://cran.r-project.org/web/packages/ggplot2/ggplot2.pdf
library(gridExtra) #http://cran.r-project.org/web/packages/gridExtra/gridExtra.pdf
library(knitr) # http://cran.r-project.org/web/packages/knitr/knitr.pdf
library(googleVis) # http://cran.r-project.org/web/packages/googleVis/googleVis.pdf
library(xtable)

Read Data

data.location=2 #1:local 2:web
data.file="all_month.csv"
if(data.location==1){
username<-Sys.info()['user']
path01<-paste("C:/Users/",username,"/Desktop/Earthquake_Data/",sep="")
setwd(path01)
dataset<-read.table(file=paste(path01,data.file,sep=""),sep=",",header=T,as.is=T,skip=0)
}else{
dataset<-read.csv(paste("http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/",data.file,sep=""),header=T,as.is=T,skip=0) 
}
dataset.j<-dataset[grep("Japan",dataset[,14]),]

Part of Data

head(dataset,1)
##                       time latitude longitude depth  mag magType nst gap
## 1 2014-09-30T05:41:09.790Z    36.63    -120.8  6.37 2.19      md  30 124
##     dmin  rms net         id                  updated
## 1 0.0479 0.08  nc nc72317446 2014-09-30T05:43:00.747Z
##                                     place       type
## 1 40km SSW of South Dos Palos, California earthquake
tail(dataset,1)
##                          time latitude longitude depth mag magType nst
## 9459 2014-08-31T05:48:48.000Z    65.14    -148.9   9.6 1.2      ml  13
##        gap dmin  rms net         id                  updated
## 9459 154.8   NA 0.43  ak ak11373124 2014-09-11T02:18:55.947Z
##                         place       type
## 9459 52km NW of Ester, Alaska earthquake

Map for Earthquake over magnitude 5.0 in the past 30 days

dataset$latlong<-paste(dataset$latitude,dataset$longitude,sep=":")
dataset$jst<-as.POSIXct(sub("Z","",sub("T"," ",dataset$time)))+3600*9
dataset$info<-paste("Time(UTC)=",dataset$time," , UTC+9=",dataset$jst,", Depth(km)=",dataset$depth,", Mag=",dataset$mag," , MagType=",dataset$magType,", Place=",dataset$place,sep="")
dataset.s<-subset(dataset,5<=dataset[,5])
gMap<-gvisMap(
dataset.s,"latlong","info",
options=list(
showTip=TRUE, 
showLine=TRUE, 
enableScrollWheel=TRUE,
mapType='terrain', #'hybrid','normal','terrain','satellite'
useMapTypeControl=TRUE
)
)
print(gMap,tag="chart")




Number of Earthquakes in the past 30days by Magnitude

  • Ratio(%)=Japan/World*100
region<-c("","Japan","Indonesia","Mexico","Alaska")
mgt<-c(0,1,2.5,4.5,5.5)
Ecount<-matrix(nrow=length(mgt),ncol=length(region))
for(rrr in 1:length(region)){
r.dataset<-dataset[grep(region[rrr],dataset[,14]),]
for(mmm in 1:length(mgt)){
count<-length(subset(r.dataset,mgt[mmm]<=r.dataset[,5])[,1])
Ecount[mmm,rrr]<-count
}
}
Ecount<-as.data.frame(Ecount,stringsAsFactors=F)
rownames(Ecount)<-paste("over",mgt,sep="")
rownames(Ecount)[1]<-"All"
colnames(Ecount)<-region
colnames(Ecount)[1]<-"World"
Ratio<-signif(Ecount$Japan/Ecount$World*100,digits=2)
Ecount<-cbind(Ecount,Ratio)
Ecount<-Ecount[,c(1,2,6,3,4,5)]
print(xtable(Ecount),type="html")


World Japan Ratio Indonesia Mexico Alaska
All 9421 36 0.38 62 58 3273
over1 6003 36 0.60 62 58 2295
over2.5 1237 36 2.90 62 32 233
over4.5 390 30 7.70 48 13 9
over5.5 22 1 4.50 5 1 1

Histogram

bw=c(5,5,10,0.1)
for(rrr in 1:length(region)){
r.dataset<-dataset[grep(region[rrr],dataset[,14]),]
if(rrr==1){PlotTitle<-"World"}else{PlotTitle<-region[rrr]}
for(ppp in 1:4){ 
switch(ppp,
g<-ggplot(r.dataset,aes(x=latitude)),
g<-ggplot(r.dataset,aes(x=longitude)),
g<-ggplot(r.dataset,aes(x=depth)),
g<-ggplot(r.dataset,aes(x=mag))
)  
g<-g+geom_histogram(alpha=0.2,binwidth=bw[ppp],colour="blue")
g<-g+labs(title=PlotTitle)
g<-g+theme(plot.title=element_text(size=9))
g<-g+theme(axis.title.x=element_text(size=9),axis.title.y=element_text(size=9)) 
g<-g+theme(axis.text.x=element_text(size=9),axis.text.y=element_text(size=9)) 
switch(ppp,
lat<-g,
lon<-g,
dep<-g,
magn<-g
)
}
grid.arrange(lat,lon,dep,magn,nrow=1,ncol=4)
}

plot of chunk unnamed-chunk-7plot of chunk unnamed-chunk-7plot of chunk unnamed-chunk-7plot of chunk unnamed-chunk-7plot of chunk unnamed-chunk-7

Latest Earthquake

print(dataset[,18][1])
## [1] "Time(UTC)=2014-09-30T05:41:09.790Z , UTC+9=2014-09-30 14:41:09, Depth(km)=6.37, Mag=2.19 , MagType=md, Place=40km SSW of South Dos Palos, California"

Maximum Magnitude Earth Quake in the past 30 days

row.id<-which(max(dataset[,5])==dataset[,5])
print(dataset[,18][row.id])
## [1] "Time(UTC)=2014-09-17T06:14:46.200Z , UTC+9=2014-09-17 15:14:46, Depth(km)=136.7, Mag=6.7 , MagType=mwc, Place=45km NW of Piti Village, Guam"

Data over mag5.0

kable(dataset.s[,c(17,5,6,14)])
## 
## 
## |     |jst                 | mag|magType |place                                                      |
## |:----|:-------------------|---:|:-------|:----------------------------------------------------------|
## |129  |2014-09-29 22:43:01 | 5.3|mb      |101km WNW of Hofn, Iceland                                 |
## |228  |2014-09-29 10:38:12 | 5.3|mb      |22km ESE of Kurush, Russia                                 |
## |383  |2014-09-28 17:46:32 | 5.2|mb      |81km WSW of Constitucion, Chile                            |
## |418  |2014-09-28 15:23:34 | 5.2|mb      |245km WNW of Pangai, Tonga                                 |
## |477  |2014-09-28 07:49:04 | 5.2|mb      |14km S of Farkhar, Afghanistan                             |
## |545  |2014-09-27 23:39:23 | 5.1|mb      |100km S of Kotaagung, Indonesia                            |
## |793  |2014-09-27 05:34:16 | 5.3|mb      |28km NW of Lae, Papua New Guinea                           |
## |848  |2014-09-27 03:29:10 | 5.1|mb      |220km SE of Sarangani, Philippines                         |
## |931  |2014-09-27 01:16:03 | 5.0|mb      |6km S of Gigmoto, Philippines                              |
## |1498 |2014-09-26 13:21:24 | 5.4|mb      |285km ENE of Port Blair, India                             |
## |1519 |2014-09-26 12:55:34 | 5.3|mb      |41km NW of Lae, Papua New Guinea                           |
## |1723 |2014-09-26 03:59:58 | 5.1|mb      |79km NNW of Visokoi Island,                                |
## |1732 |2014-09-26 02:51:17 | 6.2|ml      |94km WNW of Willow, Alaska                                 |
## |1867 |2014-09-25 19:35:02 | 5.0|mb      |20km ENE of Taitung City, Taiwan                           |
## |1880 |2014-09-25 18:13:50 | 6.0|mb      |160km SSW of Gizo, Solomon Islands                         |
## |1909 |2014-09-25 15:16:12 | 5.1|mb      |100km NNE of Awaran, Pakistan                              |
## |1938 |2014-09-25 11:31:58 | 5.5|mwb     |92km WSW of Khuzdar, Pakistan                              |
## |2044 |2014-09-24 22:30:57 | 5.1|mww     |30km ENE of Namie, Japan                                   |
## |2048 |2014-09-24 21:45:46 | 5.0|mb      |41km E of Namie, Japan                                     |
## |2063 |2014-09-24 20:16:12 | 6.2|mwp     |46km NNW of San Antonio de los Cobres, Argentina           |
## |2114 |2014-09-24 15:34:36 | 5.1|mb      |144km NW of Constitucion, Chile                            |
## |2134 |2014-09-24 13:43:26 | 5.0|mb      |192km S of Puerto El Triunfo, El Salvador                  |
## |2228 |2014-09-24 04:18:25 | 5.4|mww     |Reykjanes Ridge                                            |
## |2323 |2014-09-24 00:24:01 | 5.4|mb      |128km SSW of Kokopo, Papua New Guinea                      |
## |2372 |2014-09-23 19:22:19 | 5.3|mb      |90km SW of Tinabogan, Indonesia                            |
## |2422 |2014-09-23 13:34:00 | 5.1|mb      |111km WNW of Hofn, Iceland                                 |
## |2521 |2014-09-23 03:35:46 | 5.1|mb      |West Chile Rise                                            |
## |2552 |2014-09-23 01:15:54 | 5.0|mb      |65km SSE of Pangai, Tonga                                  |
## |2554 |2014-09-23 01:01:42 | 5.7|mwb     |85km NNW of Visokoi Island,                                |
## |2566 |2014-09-22 23:41:22 | 5.4|mb      |37km SE of Palmerston North, New Zealand                   |
## |2737 |2014-09-22 02:32:04 | 5.2|mb      |270km WNW of Chichi-shima, Japan                           |
## |2749 |2014-09-22 00:45:20 | 5.2|mb      |Easter Island region                                       |
## |2755 |2014-09-22 00:05:27 | 5.2|mb      |252km NNE of Whakatane, New Zealand                        |
## |2757 |2014-09-22 00:02:30 | 5.3|mb      |227km ENE of Tairua, New Zealand                           |
## |2796 |2014-09-21 19:51:48 | 5.1|mb      |107km WNW of Hofn, Iceland                                 |
## |2893 |2014-09-21 09:43:43 | 5.2|mb      |2km WSW of Nafpaktos, Greece                               |
## |2945 |2014-09-21 03:27:13 | 5.5|mb      |26km ENE of Manokwari, Indonesia                           |
## |3072 |2014-09-20 14:12:17 | 5.0|mb      |62km SSW of Ocos, Guatemala                                |
## |3078 |2014-09-20 13:26:10 | 5.2|mb      |10km ESE of Bulatukan, Philippines                         |
## |3096 |2014-09-20 12:03:53 | 5.2|mb      |108km SW of Mapastepec, Mexico                             |
## |3111 |2014-09-20 10:10:14 | 5.0|mb      |99km WNW of Hofn, Iceland                                  |
## |3219 |2014-09-19 21:55:51 | 5.3|mb      |62km SSE of Kirakira, Solomon Islands                      |
## |3303 |2014-09-19 11:57:35 | 5.1|mb      |147km ESE of Sarangani, Philippines                        |
## |3404 |2014-09-18 23:21:49 | 5.0|mb      |102km NW of Hofn, Iceland                                  |
## |3413 |2014-09-18 22:14:16 | 5.1|mb      |65km WNW of Sardinal, Costa Rica                           |
## |3484 |2014-09-18 13:17:53 | 5.4|mb      |204km NNE of Vostok, Russia                                |
## |3521 |2014-09-18 08:18:55 | 5.4|mb      |11km ENE of Hirara, Japan                                  |
## |3656 |2014-09-17 19:36:48 | 5.0|mb      |78km SE of Lukatan, Philippines                            |
## |3712 |2014-09-17 15:14:46 | 6.7|mwc     |45km NW of Piti Village, Guam                              |
## |3714 |2014-09-17 15:11:49 | 5.6|mb      |59km E of Lakatoro, Vanuatu                                |
## |3751 |2014-09-17 11:29:50 | 5.0|mb      |101km SSE of Bengkulu, Indonesia                           |
## |3804 |2014-09-17 06:34:15 | 5.1|mb      |108km WNW of Hofn, Iceland                                 |
## |3841 |2014-09-17 03:39:46 | 5.2|mb      |69km WSW of Kuril'sk, Russia                               |
## |3860 |2014-09-17 01:49:35 | 5.1|mb      |73km SE of Punta de Burica, Panama                         |
## |3910 |2014-09-16 22:00:20 | 5.3|mb      |190km SSW of Ndoi Island, Fiji                             |
## |4033 |2014-09-16 12:28:31 | 5.6|mb      |2km WNW of Iwai, Japan                                     |
## |4044 |2014-09-16 11:35:19 | 5.6|mb      |189km ESE of Kimbe, Papua New Guinea                       |
## |4059 |2014-09-16 10:08:19 | 5.2|mb      |38km SW of Ndoi Island, Fiji                               |
## |4098 |2014-09-16 06:09:08 | 5.4|mb      |81km E of Le Vauclin, Martinique                           |
## |4224 |2014-09-15 18:43:25 | 5.0|mb      |143km S of Sarangani, Philippines                          |
## |4240 |2014-09-15 17:05:02 | 5.3|mb      |108km WNW of Hofn, Iceland                                 |
## |4393 |2014-09-15 03:17:44 | 5.0|mb      |55km ENE of `Ohonua, Tonga                                 |
## |4410 |2014-09-15 01:34:22 | 5.1|mb      |176km SSE of Sinabang, Indonesia                           |
## |4536 |2014-09-14 13:52:26 | 5.3|mb      |179km SSE of Sinabang, Indonesia                           |
## |4608 |2014-09-14 07:31:59 | 5.3|mb      |8km WSW of `Alaqahdari-ye Kiran wa Munjan, Afghanistan     |
## |4649 |2014-09-14 03:22:14 | 5.4|mb      |125km NE of Neiafu, Tonga                                  |
## |4759 |2014-09-13 16:58:17 | 5.0|mb      |116km S of Akureyri, Iceland                               |
## |4932 |2014-09-13 00:41:48 | 5.1|mb      |72km NE of Amahai, Indonesia                               |
## |4951 |2014-09-12 22:06:33 | 5.0|mb      |106km NW of Mohean, India                                  |
## |5002 |2014-09-12 18:25:57 | 5.3|mb      |100km W of Sabang, Indonesia                               |
## |5017 |2014-09-12 16:56:54 | 5.0|mb      |180km WNW of Abepura, Indonesia                            |
## |5020 |2014-09-12 16:47:27 | 5.3|mb      |209km NNW of Farallon de Pajaros, Northern Mariana Islands |
## |5058 |2014-09-12 13:04:08 | 5.0|mb      |61km SSW of Sola, Vanuatu                                  |
## |5071 |2014-09-12 12:19:31 | 5.1|mb      |300km NE of Palmer Station, Antarctica                     |
## |5084 |2014-09-12 11:22:57 | 5.0|mb      |82km SSE of Panguna, Papua New Guinea                      |
## |5169 |2014-09-12 04:57:16 | 5.1|mb      |113km SSE of Akureyri, Iceland                             |
## |5200 |2014-09-12 01:58:12 | 5.1|mb      |70km E of Luganville, Vanuatu                              |
## |5388 |2014-09-11 09:07:41 | 5.1|mb      |97km WNW of Hofn, Iceland                                  |
## |5453 |2014-09-11 03:27:59 | 5.3|mb      |23km NW of Little Sitkin Island, Alaska                    |
## |5480 |2014-09-11 01:31:59 | 5.3|mb      |South of the Fiji Islands                                  |
## |5520 |2014-09-10 23:01:01 | 5.0|mb      |131km E of Tadine, New Caledonia                           |
## |5576 |2014-09-10 18:32:59 | 5.6|mb      |141km SE of Lolayan, Indonesia                             |
## |5602 |2014-09-10 16:30:52 | 5.0|mb      |144km SE of Modayag, Indonesia                             |
## |5623 |2014-09-10 14:59:47 | 5.0|mb      |146km SE of Modayag, Indonesia                             |
## |5630 |2014-09-10 14:19:25 | 5.6|mb      |126km SE of Modayag, Indonesia                             |
## |5633 |2014-09-10 14:16:53 | 5.7|mb      |129km SE of Lolayan, Indonesia                             |
## |5658 |2014-09-10 11:46:06 | 6.2|mww     |132km SE of Modayag, Indonesia                             |
## |5683 |2014-09-10 10:09:37 | 5.1|mb      |49km E of Ichinohe, Japan                                  |
## |5773 |2014-09-10 03:15:00 | 5.0|mb      |Western Indian-Antarctic Ridge                             |
## |5884 |2014-09-09 18:28:23 | 5.4|mb      |40km SSE of Saiha, India                                   |
## |5989 |2014-09-09 10:07:32 | 5.4|mwp     |118km WNW of Hofn, Iceland                                 |
## |6001 |2014-09-09 09:26:24 | 5.1|mb      |43km S of Manubul, Philippines                             |
## |6092 |2014-09-09 02:53:17 | 5.3|mb      |104km E of Madang, Papua New Guinea                        |
## |6468 |2014-09-08 00:55:50 | 5.2|mb      |283km SE of Pondaguitan, Philippines                       |
## |6526 |2014-09-07 20:46:21 | 5.1|mb      |Federated States of Micronesia region                      |
## |6600 |2014-09-07 16:07:59 | 5.2|mb      |117km WNW of Hofn, Iceland                                 |
## |6628 |2014-09-07 14:23:48 | 5.0|mb      |100km WNW of Rabaul, Papua New Guinea                      |
## |6737 |2014-09-07 04:52:57 | 5.3|mb      |Easter Island region                                       |
## |6741 |2014-09-07 04:23:00 | 5.9|mwb     |222km WSW of Tomatlan, Mexico                              |
## |6847 |2014-09-06 17:37:46 | 5.1|mb      |Easter Island region                                       |
## |6856 |2014-09-06 16:48:34 | 5.4|mb      |Easter Island region                                       |
## |6880 |2014-09-06 16:04:07 | 5.2|mb      |Easter Island region                                       |
## |6884 |2014-09-06 15:53:13 | 6.1|mb      |Easter Island region                                       |
## |6905 |2014-09-06 15:03:53 | 5.1|mb      |165km NNW of Visokoi Island,                               |
## |6907 |2014-09-06 14:40:51 | 5.0|mb      |112km SSE of Akureyri, Iceland                             |
## |6981 |2014-09-06 09:37:00 | 5.0|mb      |48km NW of Citeureup, Indonesia                            |
## |7024 |2014-09-06 06:24:38 | 5.3|mb      |Easter Island region                                       |
## |7046 |2014-09-06 04:36:32 | 5.8|mww     |Easter Island region                                       |
## |7164 |2014-09-05 18:19:24 | 5.1|mb      |Easter Island region                                       |
## |7188 |2014-09-05 16:21:51 | 5.2|mb      |116km N of Hirara, Japan                                   |
## |7264 |2014-09-05 10:19:38 | 5.2|mb      |104km WNW of Hofn, Iceland                                 |
## |7337 |2014-09-05 06:00:04 | 5.3|mww     |41km SE of Tekirova, Turkey                                |
## |7385 |2014-09-05 02:43:40 | 5.0|mwr     |36km NW of Myrina, Greece                                  |
## |7390 |2014-09-05 02:23:15 | 5.4|mwc     |Easter Island region                                       |
## |7506 |2014-09-04 18:26:53 | 5.1|mb      |57km SSW of Iquique, Chile                                 |
## |7563 |2014-09-04 14:33:46 | 6.0|mwb     |175km E of `Ohonua, Tonga                                  |
## |7633 |2014-09-04 08:34:14 | 5.2|mb      |43km S of George Town, Cayman Islands                      |
## |7669 |2014-09-04 05:33:59 | 5.9|mww     |Easter Island region                                       |
## |7670 |2014-09-04 05:28:22 | 5.2|mb      |Easter Island region                                       |
## |7744 |2014-09-04 00:14:52 | 5.2|mb      |53km SSE of Kirakira, Solomon Islands                      |
## |7767 |2014-09-03 22:43:58 | 5.3|mb      |37km ENE of Carlagan, Philippines                          |
## |7798 |2014-09-03 20:34:40 | 5.7|mww     |138km SSW of Gataivai, Samoa                               |
## |7828 |2014-09-03 19:01:04 | 5.1|mb      |35km S of George Town, Cayman Islands                      |
## |7866 |2014-09-03 16:43:31 | 5.7|mb      |107km NNE of Hihifo, Tonga                                 |
## |7867 |2014-09-03 16:24:20 | 5.2|mb      |21km NW of Nikko, Japan                                    |
## |7929 |2014-09-03 12:09:56 | 5.2|mb      |108km SSE of Akureyri, Iceland                             |
## |7979 |2014-09-03 08:41:31 | 5.5|mwp     |Central East Pacific Rise                                  |
## |8025 |2014-09-03 05:00:12 | 5.2|mb      |192km NE of Raoul Island, New Zealand                      |
## |8358 |2014-09-02 07:55:22 | 5.2|mb      |19km NE of Minas de Marcona, Peru                          |
## |8447 |2014-09-02 03:58:34 | 5.1|mb      |183km NE of Flying Fish Cove, Christmas Island             |
## |8615 |2014-09-01 20:41:10 | 5.2|mb      |114km WNW of Hofn, Iceland                                 |
## |8771 |2014-09-01 13:24:15 | 5.2|mb      |South of Tonga                                             |
## |8795 |2014-09-01 11:49:48 | 5.0|mb      |99km NE of Namuac, Philippines                             |
## |9018 |2014-09-01 02:54:38 | 5.0|mb      |153km SE of Lata, Solomon Islands                          |
## |9123 |2014-08-31 23:44:34 | 5.0|mb      |24km ESE of Mandali, Iraq                                  |
## |9220 |2014-08-31 21:01:47 | 5.1|mb      |111km SSE of Akureyri, Iceland                             |
## |9227 |2014-08-31 20:48:24 | 5.1|mb      |34km SSE of Jarm, Afghanistan                              |