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

0.1 Execution

Sys.time()
## [1] "2014-10-02 12:58:39 JST"

0.2 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)

0.3 Import Raw 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]),]

0.4 Part of Raw Data

head(dataset,1)
##                       time latitude longitude depth mag magType nst gap
## 1 2014-10-02T03:34:49.600Z     13.9     -92.5 36.52 4.3      mb  NA 177
##    dmin  rms net         id                  updated
## 1 0.998 0.87  us usb000si1y 2014-10-02T03:46:12.000Z
##                         place       type
## 1 75km SSW of Ocos, Guatemala earthquake
tail(dataset,1)
##                          time latitude longitude depth mag magType nst
## 8855 2014-09-02T03:48:12.800Z    46.52    -122.4  19.8 0.3      Md  NA
##        gap    dmin  rms net         id                  updated
## 8855 205.2 0.09881 0.06  uw uw60081708 2014-09-09T05:12:07.132Z
##                               place       type
## 8855 13km WSW of Morton, Washington earthquake

0.5 Map for Earthquakes 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")

0.6 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 8800 36 0.41 56 54 2529
over1 5694 36 0.63 56 54 1947
over2.5 1233 36 2.90 56 33 210
over4.5 388 29 7.50 45 13 9
over5.5 25 1 4.00 5 1 1

0.7 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

0.8 Latest Earthquake

print(dataset[,18][1])
## [1] "Time(UTC)=2014-10-02T03:34:49.600Z , UTC+9=2014-10-02 12:34:49, Depth(km)=36.52, Mag=4.3 , MagType=mb, Place=75km SSW of Ocos, Guatemala"

0.9 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"

0.10 Earthquake List Over Mag5.0

Elist<-dataset.s[,c(17,5,6,14)]
kable(Elist)
## 
## 
## |     |jst                 | mag|magType |place                                                      |
## |:----|:-------------------|---:|:-------|:----------------------------------------------------------|
## |27   |2014-10-02 09:13:39 | 5.0|mb      |57km ENE of `Ohonua, Tonga                                 |
## |69   |2014-10-02 04:20:11 | 5.1|mb      |Northern Mid-Atlantic Ridge                                |
## |223  |2014-10-01 12:38:54 | 5.7|mb      |20km NNW of Kandrian, Papua New Guinea                     |
## |247  |2014-10-01 10:23:30 | 5.1|mb      |42km SE of Yuecheng, China                                 |
## |272  |2014-10-01 07:34:27 | 5.5|mwp     |264km SE of Lambasa, Fiji                                  |
## |303  |2014-10-01 04:23:54 | 5.2|mb      |34km N of Taron, Papua New Guinea                          |
## |324  |2014-10-01 01:45:58 | 5.5|mb      |Carlsberg Ridge                                            |
## |345  |2014-09-30 22:46:26 | 5.2|mb      |53km NNW of Finschhafen, Papua New Guinea                  |
## |545  |2014-09-29 22:43:01 | 5.3|mb      |101km WNW of Hofn, Iceland                                 |
## |658  |2014-09-29 10:38:12 | 5.3|mb      |22km ESE of Kurush, Russia                                 |
## |818  |2014-09-28 17:46:32 | 5.2|mb      |81km WSW of Constitucion, Chile                            |
## |853  |2014-09-28 15:23:34 | 5.2|mb      |245km WNW of Pangai, Tonga                                 |
## |913  |2014-09-28 07:49:04 | 5.2|mb      |14km S of Farkhar, Afghanistan                             |
## |983  |2014-09-27 23:39:23 | 5.1|mb      |100km S of Kotaagung, Indonesia                            |
## |1244 |2014-09-27 05:34:16 | 5.3|mb      |28km NW of Lae, Papua New Guinea                           |
## |1299 |2014-09-27 03:29:10 | 5.1|mb      |220km SE of Sarangani, Philippines                         |
## |1383 |2014-09-27 01:16:03 | 5.0|mb      |6km S of Gigmoto, Philippines                              |
## |1971 |2014-09-26 13:21:24 | 5.4|mb      |285km ENE of Port Blair, India                             |
## |1992 |2014-09-26 12:55:34 | 5.3|mb      |41km NW of Lae, Papua New Guinea                           |
## |2197 |2014-09-26 03:59:58 | 5.1|mb      |79km NNW of Visokoi Island,                                |
## |2206 |2014-09-26 02:51:17 | 6.2|ml      |94km WNW of Willow, Alaska                                 |
## |2345 |2014-09-25 19:35:02 | 5.0|mb      |20km ENE of Taitung City, Taiwan                           |
## |2358 |2014-09-25 18:13:50 | 6.0|mb      |160km SSW of Gizo, Solomon Islands                         |
## |2386 |2014-09-25 15:16:12 | 5.1|mb      |100km NNE of Awaran, Pakistan                              |
## |2415 |2014-09-25 11:31:58 | 5.5|mwb     |92km WSW of Khuzdar, Pakistan                              |
## |2523 |2014-09-24 22:30:57 | 5.1|mww     |30km ENE of Namie, Japan                                   |
## |2527 |2014-09-24 21:45:46 | 5.0|mb      |41km E of Namie, Japan                                     |
## |2542 |2014-09-24 20:16:12 | 6.2|mwp     |46km NNW of San Antonio de los Cobres, Argentina           |
## |2594 |2014-09-24 15:34:36 | 5.1|mb      |144km NW of Constitucion, Chile                            |
## |2617 |2014-09-24 13:43:26 | 5.0|mb      |192km S of Puerto El Triunfo, El Salvador                  |
## |2712 |2014-09-24 04:18:25 | 5.4|mww     |Reykjanes Ridge                                            |
## |2808 |2014-09-24 00:24:01 | 5.4|mb      |128km SSW of Kokopo, Papua New Guinea                      |
## |2860 |2014-09-23 19:22:19 | 5.3|mb      |90km SW of Tinabogan, Indonesia                            |
## |2913 |2014-09-23 13:34:00 | 5.1|mb      |111km WNW of Hofn, Iceland                                 |
## |3019 |2014-09-23 03:35:46 | 5.1|mb      |West Chile Rise                                            |
## |3053 |2014-09-23 01:15:54 | 5.0|mb      |65km SSE of Pangai, Tonga                                  |
## |3055 |2014-09-23 01:01:42 | 5.7|mwb     |85km NNW of Visokoi Island,                                |
## |3068 |2014-09-22 23:41:22 | 5.4|mb      |37km SE of Palmerston North, New Zealand                   |
## |3246 |2014-09-22 02:32:04 | 5.2|mb      |270km WNW of Chichi-shima, Japan                           |
## |3260 |2014-09-22 00:45:20 | 5.2|mb      |Easter Island region                                       |
## |3266 |2014-09-22 00:05:27 | 5.2|mb      |252km NNE of Whakatane, New Zealand                        |
## |3268 |2014-09-22 00:02:30 | 5.3|mb      |227km ENE of Tairua, New Zealand                           |
## |3310 |2014-09-21 19:51:48 | 5.1|mb      |107km WNW of Hofn, Iceland                                 |
## |3411 |2014-09-21 09:43:43 | 5.2|mb      |2km WSW of Nafpaktos, Greece                               |
## |3467 |2014-09-21 03:27:13 | 5.5|mb      |26km ENE of Manokwari, Indonesia                           |
## |3602 |2014-09-20 14:12:17 | 5.0|mb      |62km SSW of Ocos, Guatemala                                |
## |3608 |2014-09-20 13:26:10 | 5.2|mb      |10km ESE of Bulatukan, Philippines                         |
## |3626 |2014-09-20 12:03:53 | 5.2|mb      |108km SW of Mapastepec, Mexico                             |
## |3642 |2014-09-20 10:10:14 | 5.0|mb      |99km WNW of Hofn, Iceland                                  |
## |3755 |2014-09-19 21:55:51 | 5.3|mb      |62km SSE of Kirakira, Solomon Islands                      |
## |3842 |2014-09-19 11:57:35 | 5.1|mb      |147km ESE of Sarangani, Philippines                        |
## |3944 |2014-09-18 23:21:49 | 5.0|mb      |102km NW of Hofn, Iceland                                  |
## |3953 |2014-09-18 22:14:16 | 5.1|mb      |65km WNW of Sardinal, Costa Rica                           |
## |4024 |2014-09-18 13:17:53 | 5.4|mb      |204km NNE of Vostok, Russia                                |
## |4061 |2014-09-18 08:18:55 | 5.4|mb      |11km ENE of Hirara, Japan                                  |
## |4196 |2014-09-17 19:36:48 | 5.0|mb      |78km SE of Lukatan, Philippines                            |
## |4252 |2014-09-17 15:14:46 | 6.7|mwc     |45km NW of Piti Village, Guam                              |
## |4254 |2014-09-17 15:11:49 | 5.6|mb      |59km E of Lakatoro, Vanuatu                                |
## |4291 |2014-09-17 11:29:50 | 5.0|mb      |101km SSE of Bengkulu, Indonesia                           |
## |4344 |2014-09-17 06:34:15 | 5.1|mb      |108km WNW of Hofn, Iceland                                 |
## |4381 |2014-09-17 03:39:46 | 5.2|mb      |69km WSW of Kuril'sk, Russia                               |
## |4400 |2014-09-17 01:49:35 | 5.1|mb      |73km SE of Punta de Burica, Panama                         |
## |4451 |2014-09-16 22:00:20 | 5.3|mb      |190km SSW of Ndoi Island, Fiji                             |
## |4576 |2014-09-16 12:28:31 | 5.6|mb      |2km WNW of Iwai, Japan                                     |
## |4587 |2014-09-16 11:35:19 | 5.6|mb      |189km ESE of Kimbe, Papua New Guinea                       |
## |4602 |2014-09-16 10:08:19 | 5.2|mb      |38km SW of Ndoi Island, Fiji                               |
## |4642 |2014-09-16 06:09:08 | 5.4|mb      |81km E of Le Vauclin, Martinique                           |
## |4769 |2014-09-15 18:43:25 | 5.0|mb      |143km S of Sarangani, Philippines                          |
## |4785 |2014-09-15 17:05:02 | 5.3|mb      |108km WNW of Hofn, Iceland                                 |
## |4940 |2014-09-15 03:17:44 | 5.0|mb      |55km ENE of `Ohonua, Tonga                                 |
## |4957 |2014-09-15 01:34:22 | 5.1|mb      |176km SSE of Sinabang, Indonesia                           |
## |5082 |2014-09-14 13:52:26 | 5.3|mb      |179km SSE of Sinabang, Indonesia                           |
## |5154 |2014-09-14 07:31:59 | 5.3|mb      |8km WSW of `Alaqahdari-ye Kiran wa Munjan, Afghanistan     |
## |5195 |2014-09-14 03:22:14 | 5.4|mb      |125km NE of Neiafu, Tonga                                  |
## |5305 |2014-09-13 16:58:17 | 5.0|mb      |116km S of Akureyri, Iceland                               |
## |5478 |2014-09-13 00:41:48 | 5.1|mb      |72km NE of Amahai, Indonesia                               |
## |5497 |2014-09-12 22:06:33 | 5.0|mb      |106km NW of Mohean, India                                  |
## |5548 |2014-09-12 18:25:57 | 5.3|mb      |100km W of Sabang, Indonesia                               |
## |5563 |2014-09-12 16:56:54 | 5.0|mb      |180km WNW of Abepura, Indonesia                            |
## |5566 |2014-09-12 16:47:27 | 5.3|mb      |209km NNW of Farallon de Pajaros, Northern Mariana Islands |
## |5604 |2014-09-12 13:04:08 | 5.0|mb      |61km SSW of Sola, Vanuatu                                  |
## |5617 |2014-09-12 12:19:31 | 5.1|mb      |300km NE of Palmer Station, Antarctica                     |
## |5630 |2014-09-12 11:22:57 | 5.0|mb      |82km SSE of Panguna, Papua New Guinea                      |
## |5715 |2014-09-12 04:57:16 | 5.1|mb      |113km SSE of Akureyri, Iceland                             |
## |5746 |2014-09-12 01:58:12 | 5.1|mb      |70km E of Luganville, Vanuatu                              |
## |5934 |2014-09-11 09:07:41 | 5.1|mb      |97km WNW of Hofn, Iceland                                  |
## |6001 |2014-09-11 03:27:59 | 5.3|mb      |23km NW of Little Sitkin Island, Alaska                    |
## |6029 |2014-09-11 01:31:59 | 5.3|mb      |South of the Fiji Islands                                  |
## |6069 |2014-09-10 23:01:01 | 5.0|mb      |131km E of Tadine, New Caledonia                           |
## |6125 |2014-09-10 18:32:59 | 5.6|mb      |141km SE of Lolayan, Indonesia                             |
## |6151 |2014-09-10 16:30:52 | 5.0|mb      |144km SE of Modayag, Indonesia                             |
## |6172 |2014-09-10 14:59:47 | 5.0|mb      |146km SE of Modayag, Indonesia                             |
## |6179 |2014-09-10 14:19:25 | 5.6|mb      |126km SE of Modayag, Indonesia                             |
## |6182 |2014-09-10 14:16:53 | 5.7|mb      |129km SE of Lolayan, Indonesia                             |
## |6207 |2014-09-10 11:46:06 | 6.2|mww     |132km SE of Modayag, Indonesia                             |
## |6232 |2014-09-10 10:09:37 | 5.1|mb      |49km E of Ichinohe, Japan                                  |
## |6322 |2014-09-10 03:15:00 | 5.0|mb      |Western Indian-Antarctic Ridge                             |
## |6433 |2014-09-09 18:28:23 | 5.4|mb      |40km SSE of Saiha, India                                   |
## |6538 |2014-09-09 10:07:32 | 5.4|mwp     |118km WNW of Hofn, Iceland                                 |
## |6550 |2014-09-09 09:26:24 | 5.1|mb      |43km S of Manubul, Philippines                             |
## |6644 |2014-09-09 02:53:17 | 5.3|mb      |104km E of Madang, Papua New Guinea                        |
## |7020 |2014-09-08 00:55:50 | 5.2|mb      |283km SE of Pondaguitan, Philippines                       |
## |7078 |2014-09-07 20:46:21 | 5.1|mb      |Federated States of Micronesia region                      |
## |7152 |2014-09-07 16:07:59 | 5.2|mb      |117km WNW of Hofn, Iceland                                 |
## |7180 |2014-09-07 14:23:48 | 5.0|mb      |100km WNW of Rabaul, Papua New Guinea                      |
## |7289 |2014-09-07 04:52:57 | 5.3|mb      |Easter Island region                                       |
## |7293 |2014-09-07 04:23:00 | 5.9|mwb     |222km WSW of Tomatlan, Mexico                              |
## |7399 |2014-09-06 17:37:46 | 5.1|mb      |Easter Island region                                       |
## |7408 |2014-09-06 16:48:34 | 5.4|mb      |Easter Island region                                       |
## |7432 |2014-09-06 16:04:07 | 5.2|mb      |Easter Island region                                       |
## |7436 |2014-09-06 15:53:13 | 6.1|mb      |Easter Island region                                       |
## |7457 |2014-09-06 15:03:53 | 5.1|mb      |165km NNW of Visokoi Island,                               |
## |7459 |2014-09-06 14:40:51 | 5.0|mb      |112km SSE of Akureyri, Iceland                             |
## |7533 |2014-09-06 09:37:00 | 5.0|mb      |48km NW of Citeureup, Indonesia                            |
## |7576 |2014-09-06 06:24:38 | 5.3|mb      |Easter Island region                                       |
## |7598 |2014-09-06 04:36:32 | 5.8|mww     |Easter Island region                                       |
## |7716 |2014-09-05 18:19:24 | 5.1|mb      |Easter Island region                                       |
## |7740 |2014-09-05 16:21:51 | 5.2|mb      |116km N of Hirara, Japan                                   |
## |7816 |2014-09-05 10:19:38 | 5.2|mb      |104km WNW of Hofn, Iceland                                 |
## |7889 |2014-09-05 06:00:04 | 5.3|mww     |41km SE of Tekirova, Turkey                                |
## |7937 |2014-09-05 02:43:40 | 5.0|mwr     |36km NW of Myrina, Greece                                  |
## |7942 |2014-09-05 02:23:15 | 5.4|mwc     |Easter Island region                                       |
## |8058 |2014-09-04 18:26:53 | 5.1|mb      |57km SSW of Iquique, Chile                                 |
## |8115 |2014-09-04 14:33:46 | 6.0|mwb     |175km E of `Ohonua, Tonga                                  |
## |8189 |2014-09-04 08:34:14 | 5.2|mb      |43km S of George Town, Cayman Islands                      |
## |8225 |2014-09-04 05:33:59 | 5.9|mww     |Easter Island region                                       |
## |8226 |2014-09-04 05:28:22 | 5.2|mb      |Easter Island region                                       |
## |8300 |2014-09-04 00:14:52 | 5.2|mb      |53km SSE of Kirakira, Solomon Islands                      |
## |8323 |2014-09-03 22:43:58 | 5.3|mb      |37km ENE of Carlagan, Philippines                          |
## |8354 |2014-09-03 20:34:40 | 5.7|mww     |138km SSW of Gataivai, Samoa                               |
## |8384 |2014-09-03 19:01:04 | 5.1|mb      |35km S of George Town, Cayman Islands                      |
## |8422 |2014-09-03 16:43:31 | 5.7|mb      |107km NNE of Hihifo, Tonga                                 |
## |8423 |2014-09-03 16:24:20 | 5.2|mb      |21km NW of Nikko, Japan                                    |
## |8488 |2014-09-03 12:09:55 | 5.4|mww     |112km SSE of Akureyri, Iceland                             |
## |8540 |2014-09-03 08:41:31 | 5.5|mwp     |Central East Pacific Rise                                  |
## |8586 |2014-09-03 05:00:12 | 5.2|mb      |192km NE of Raoul Island, New Zealand                      |

0.11 Reference