The main purpose of the study is to analysis Turkey earthquake data set obtained from AFAD (The Disaster and Emergency Management Presidency) online data base using data mining techniques. In this way, it is targeted to be created awareness.

Data set includes earthquakes with magnitude between 4.0 and 8.0. Number of observations is 6510, and number of variables is 12. Earthquake data set is consisted of time series from year 1900 to date 2020-02-08. The definitions of the variables revised in the data set are given below.

[1] “Year” “Month” “Day” “Hour”
[5] “Minute” “Second” “Latitude” “Longitude”
[9] “Depth” “Magnitude” “Place” “Magnitude_Class”

Loading libraries

lapply(c("readr", "tibble", "xts", "tidyr", "dplyr", "lubridate", "formattable", "ggplot2", "ggpubr", "xlsx","formattable", "GGally", "ggrepel", "leaflet", "sf", "widgetframe", "stringr", "ggridges"), require, character.only = TRUE)
## Loading required package: readr
## Loading required package: tibble
## Loading required package: xts
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Registered S3 method overwritten by 'xts':
##   method     from
##   as.zoo.xts zoo
## Loading required package: tidyr
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:xts':
## 
##     first, last
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: lubridate
## 
## Attaching package: 'lubridate'
## The following object is masked from 'package:base':
## 
##     date
## Loading required package: formattable
## Loading required package: ggplot2
## Loading required package: ggpubr
## Loading required package: magrittr
## 
## Attaching package: 'magrittr'
## The following object is masked from 'package:tidyr':
## 
##     extract
## Loading required package: xlsx
## Loading required package: GGally
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
## 
## Attaching package: 'GGally'
## The following object is masked from 'package:dplyr':
## 
##     nasa
## Loading required package: ggrepel
## Loading required package: leaflet
## 
## Attaching package: 'leaflet'
## The following object is masked from 'package:xts':
## 
##     addLegend
## Loading required package: sf
## Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
## Loading required package: widgetframe
## Loading required package: htmlwidgets
## Loading required package: stringr
## Loading required package: ggridges
## [[1]]
## [1] TRUE
## 
## [[2]]
## [1] TRUE
## 
## [[3]]
## [1] TRUE
## 
## [[4]]
## [1] TRUE
## 
## [[5]]
## [1] TRUE
## 
## [[6]]
## [1] TRUE
## 
## [[7]]
## [1] TRUE
## 
## [[8]]
## [1] TRUE
## 
## [[9]]
## [1] TRUE
## 
## [[10]]
## [1] TRUE
## 
## [[11]]
## [1] TRUE
## 
## [[12]]
## [1] TRUE
## 
## [[13]]
## [1] TRUE
## 
## [[14]]
## [1] TRUE
## 
## [[15]]
## [1] TRUE
## 
## [[16]]
## [1] TRUE
## 
## [[17]]
## [1] TRUE
## 
## [[18]]
## [1] TRUE

Loading earthquage data set from year 1900 to date 2020-02-08

df<-read.csv("Catalogueafad08.2.2020-tamamı.csv")


names(df)
##  [1] "No"                "Zaman..UTC."       "Ref1"             
##  [4] "Kaynak.Aç.klama.1" "Enlem"             "Boylam"           
##  [7] "Derinlik"          "Sabit.Derinlik"    "Kaynak.No.2"      
## [10] "Kaynak.Aç.klama.2" "Tip"               "Büyüklük"         
## [13] "Kaynak.No.3"       "Kaynak.Aç.klama.3" "Yer"
head(df)
##   No         Zaman..UTC. Ref1 Kaynak.Aç.klama.1   Enlem  Boylam Derinlik
## 1  0 2020-01-28 20:10:26    0                   39.0131 27.8700     5.08
## 2  0 2020-01-28 14:53:51    0                   39.0831 27.8295     7.00
## 3  0 2020-01-28 11:26:14    0                   39.1001 27.8411     6.98
## 4  0 2020-01-27 16:12:00    0                   38.3950 39.1333    11.94
## 5  0 2020-01-26 10:12:17    0                   38.4111 39.1530    12.25
## 6  0 2020-01-26 02:22:45    0                   38.2440 38.8013    12.52
##   Sabit.Derinlik Kaynak.No.2 Kaynak.Aç.klama.2 Tip Büyüklük Kaynak.No.3
## 1              -           7          AFAD-DDA  Mw      4.7           7
## 2              -           7          AFAD-DDA  Mw      4.1           7
## 3              -           7          AFAD-DDA  Mw      4.8           7
## 4              -           7          AFAD-DDA  Mw      4.2           7
## 5              -           7          AFAD-DDA  Mw      4.1           7
## 6              -           7          AFAD-DDA  Mw      4.3           7
##   Kaynak.Aç.klama.3 Yer
## 1          AFAD-DDA   -
## 2          AFAD-DDA   -
## 3          AFAD-DDA   -
## 4          AFAD-DDA   -
## 5          AFAD-DDA   -
## 6          AFAD-DDA   -
dim(df)# 6462   15
## [1] 6510   15
str(df)
## 'data.frame':    6510 obs. of  15 variables:
##  $ No               : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ Zaman..UTC.      : Factor w/ 6510 levels "1900-01-18 15:30:00",..: 6510 6509 6508 6507 6506 6505 6504 6503 6502 6501 ...
##  $ Ref1             : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ Kaynak.Aç.klama.1: Factor w/ 5 levels " ","Dakika ve saniye bilgisi yok",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Enlem            : num  39 39.1 39.1 38.4 38.4 ...
##  $ Boylam           : num  27.9 27.8 27.8 39.1 39.2 ...
##  $ Derinlik         : num  5.08 7 6.98 11.94 12.25 ...
##  $ Sabit.Derinlik   : Factor w/ 2 levels "-","*": 1 1 1 1 1 1 1 1 1 1 ...
##  $ Kaynak.No.2      : int  7 7 7 7 7 7 7 7 7 7 ...
##  $ Kaynak.Aç.klama.2: Factor w/ 26 levels "AFAD-DDA","Alsan ve Di?.1975",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Tip              : Factor w/ 8 levels "mb","md","Md",..: 7 7 7 7 7 7 7 7 7 7 ...
##  $ Büyüklük         : num  4.7 4.1 4.8 4.2 4.1 4.3 4.1 4.3 4.1 4.3 ...
##  $ Kaynak.No.3      : int  7 7 7 7 7 7 7 7 7 7 ...
##  $ Kaynak.Aç.klama.3: Factor w/ 32 levels "AFAD-DDA","Alsan ve Di?.1975",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Yer              : Factor w/ 79 levels "-","?arköy-Tekirda?",..: 1 1 1 1 1 1 1 1 1 1 ...
unique(df$Yer)
##  [1] -                               Van-Merkez                     
##  [3] Kovanc?lar-Elaz??               Rodos Adas? Yunanistan         
##  [5] Bingöl                          Pülümür-Tunceli                
##  [7] Sultanda??-Afyon                Bolvadin-Afyon                 
##  [9] Orta-Çak?r?                     Düzce-Bolu                     
## [11] Gölcük-Kocaeli                  Yüre?ir-Adana                  
## [13] Akdeniz                         Dinar-Afyon                    
## [15] Sfrihisar-?zmir                 Erzican                        
## [17] Ermenistan                      ?enkaya/Erzurum-Sar?kam??/Kars 
## [19] Çald?ran-Van                    Lice-Diyarbak?r                
## [21] Kütahya                         Kula-Manisa                    
## [23] S?nd?rg?-Bal?ksir               Bart?n Aç?klar?-Karadeniz      
## [25] Tunceli                         Akyaz?-Sakarya                 
## [27] Karl?ova-Bingöl                 Varto-Mu?                      
## [29] Karacabey-Bursa                 Sincik-Ad?yaman                
## [31] Yalova                          Köyce?iz/Mu?la Aç?klar?-Akdeniz
## [33] Ege Denizi                      Eski?hir                       
## [35] Ayd?n                           Karabük                        
## [37] Çanakkale                       Çank?r?                        
## [39] ?zmir Aç?klar?-Ege Denizi       Adana                          
## [41] Edremit Aç?klar?-Ege Denizi     U?ak                           
## [43] Gerede-Bolu                     Ilgaz-Çak?r?                   
## [45] Sakarya                         Erbaa-Tokat                    
## [47] Dursunbey-Bal?kesir             Manisa                         
## [49] Mu?la Aç?klar?-Ege Denizi       A?r?                           
## [51] Mu?la                           Yozgat                         
## [53] Gürcistan                       Dikili-?zmir                   
## [55] Kaman-K?r?ehir                  Hamur-A?r?                     
## [57] Gönen-Bal?kesir                 ?ran                           
## [59] Koyulhisar-Sivas                Harmanc?k-Bursa                
## [61] ?zmir Aç?klar?- Ege Denizi      Datça Aç?klar?-Ege Dizi        
## [63] Bat? Akdeniz                    Alt?nyayla-Burdur              
## [65] Köprüköy-Erzurum                Ayval?k-Bal?kesir              
## [67] Tokat                           Burdur                         
## [69] ?arköy-Tekirda?                 Antalya Aç?klar?-Akdeniz       
## [71] Çorum                           Sefrihisar Aç?klar?/Ege Denizi 
## [73] Malatya/laz?? S?n?r?            Oltu-Erzurum                   
## [75] Kars                            Pütürge-Malatya                
## [77] Yunaistan                       Malazgirit-Mu?                 
## [79] Pasinler-Erzurum               
## 79 Levels: - ?arköy-Tekirda? ?enkaya/Erzurum-Sar?kam??/Kars ... Yüre?ir-Adana

Classification of time series by year, month, day, hour, minute, and second

df1<-df[,c(2, 5, 6, 7, 12, 15)]

year<-tibble(Year=as.integer(year(df1$Zaman..UTC.)))

month<-tibble(Month=as.integer(month(df1$Zaman..UTC.)))

day<-tibble(Day=as.integer(day(df1$Zaman..UTC.)))

hour<-tibble(Hour=as.integer(hour(df1$Zaman..UTC.)))

minute<-tibble(Minute=as.integer(minute(df1$Zaman..UTC.)))

second<-tibble(Second=as.integer(second(df1$Zaman..UTC.)))

df2<-cbind(year, month, day, hour, minute, second, Latitude=as.numeric(df1[,2]),Longitude=as.numeric(df1[,3]), Depth= as.numeric(df1[,4]),Magnitude= as.numeric(df1[,5]), Place=as.character(df1[,6]))

df2<-as_tibble(df2)


str(df2)
## Classes 'tbl_df', 'tbl' and 'data.frame':    6510 obs. of  11 variables:
##  $ Year     : int  2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 ...
##  $ Month    : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ Day      : int  28 28 28 27 26 26 25 25 25 25 ...
##  $ Hour     : int  20 14 11 16 10 2 17 16 16 16 ...
##  $ Minute   : int  10 53 26 12 12 22 49 46 45 44 ...
##  $ Second   : int  26 51 14 0 17 45 47 58 6 23 ...
##  $ Latitude : num  39 39.1 39.1 38.4 38.4 ...
##  $ Longitude: num  27.9 27.8 27.8 39.1 39.2 ...
##  $ Depth    : num  5.08 7 6.98 11.94 12.25 ...
##  $ Magnitude: num  4.7 4.1 4.8 4.2 4.1 4.3 4.1 4.3 4.1 4.3 ...
##  $ Place    : Factor w/ 79 levels "-","?arköy-Tekirda?",..: 1 1 1 1 1 1 1 1 1 1 ...
c<-as.vector(which(df2$Place=="Gürcistan"))
d<-as.vector(which(df2$Place=="Rodos Adas?"))
e<-as.vector(which(df2$Place=="Yunanistan"))
f<-as.vector(which(df2$Place=="?ran"))
g<-as.vector(which(df2$Place=="Yunaistan"))


df2<-df2[-c(c,d,e,f,g),]#

str(df2)#6510
## Classes 'tbl_df', 'tbl' and 'data.frame':    6503 obs. of  11 variables:
##  $ Year     : int  2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 ...
##  $ Month    : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ Day      : int  28 28 28 27 26 26 25 25 25 25 ...
##  $ Hour     : int  20 14 11 16 10 2 17 16 16 16 ...
##  $ Minute   : int  10 53 26 12 12 22 49 46 45 44 ...
##  $ Second   : int  26 51 14 0 17 45 47 58 6 23 ...
##  $ Latitude : num  39 39.1 39.1 38.4 38.4 ...
##  $ Longitude: num  27.9 27.8 27.8 39.1 39.2 ...
##  $ Depth    : num  5.08 7 6.98 11.94 12.25 ...
##  $ Magnitude: num  4.7 4.1 4.8 4.2 4.1 4.3 4.1 4.3 4.1 4.3 ...
##  $ Place    : Factor w/ 79 levels "-","?arköy-Tekirda?",..: 1 1 1 1 1 1 1 1 1 1 ...
#Categorizing magnitudes of earthquakes

df2<-mutate(df2, Magnitude_Class=cut(df2$Magnitude, breaks=c(3.99, 5, 6, 7, 8), labels=c("4-5", "5-6", "6-7", "7-8")))

Density of earthquakes

In chart, curve “green” indicates the average of earthquake magnitudes.On the other hand, yintercept values including earthquakes of magnitudes 5.0, 6.0, and 7.0 is shown in curve “blue”.

df2 %>% ggplot(aes(Year, Magnitude))+
        geom_point(size=1, col="red")+
        ggtitle("Density of Earthquakes by Years") +
        xlab("Year") + ylab("Magnitude")+
        scale_x_continuous(breaks=seq(min(df2$Year),max(df2$Year), 10))+
        labs(caption ="Data Source:AFAD (Disaster & Emergency Management Authority
                      Presidential of Earthquake Department)")+
        theme(plot.title = element_text(family = "Trebuchet MS", face="bold",                                                size=14, hjust=0.5)) +
        theme(axis.title = element_text(family = "Trebuchet MS", face="bold",                                                size=12))+
        geom_hline(yintercept=mean(df2$Magnitude), linetype="twodash", color =                                     "green", size=1)+
        geom_hline(yintercept=5, linetype="twodash", color = "blue", size=1)+
        geom_hline(yintercept=6, linetype="twodash", color = "blue", size=1)+
        geom_hline(yintercept=7, linetype="twodash", color = "blue", size=1)
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database

## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Number of earthquakes by years

year<-df2 %>% group_by(Year, Magnitude_Class) %>% tally()

formattable (year)
Year Magnitude_Class n
1900 4-5 33
1900 5-6 6
1901 4-5 12
1901 5-6 5
1901 6-7 1
1902 4-5 13
1902 5-6 10
1903 4-5 27
1903 5-6 5
1903 6-7 1
1904 4-5 23
1904 5-6 3
1905 4-5 9
1905 5-6 9
1905 6-7 2
1906 4-5 6
1906 5-6 2
1906 6-7 1
1907 4-5 18
1907 5-6 4
1908 4-5 20
1908 5-6 5
1908 6-7 1
1909 4-5 14
1909 5-6 7
1909 6-7 1
1910 4-5 12
1910 5-6 4
1910 6-7 1
1911 4-5 10
1911 5-6 2
1911 6-7 1
1912 4-5 11
1912 5-6 4
1912 6-7 2
1912 7-8 1
1913 4-5 3
1913 5-6 2
1914 4-5 20
1914 5-6 6
1914 6-7 1
1915 4-5 1
1915 5-6 5
1916 4-5 2
1916 5-6 2
1916 7-8 1
1917 4-5 6
1917 5-6 1
1918 4-5 2
1918 5-6 5
1918 6-7 1
1919 4-5 4
1919 5-6 6
1919 6-7 1
1920 4-5 5
1920 5-6 5
1921 5-6 7
1922 4-5 5
1922 5-6 3
1923 4-5 3
1923 5-6 4
1924 4-5 11
1924 5-6 5
1924 6-7 1
1925 4-5 19
1925 5-6 5
1926 4-5 12
1926 5-6 14
1926 6-7 2
1926 7-8 1
1927 4-5 1
1927 5-6 2
1928 4-5 7
1928 5-6 4
1928 6-7 2
1929 4-5 12
1929 5-6 2
1929 6-7 1
1930 4-5 15
1930 5-6 8
1931 4-5 6
1931 5-6 1
1932 4-5 4
1932 5-6 2
1933 4-5 9
1933 5-6 1
1933 6-7 1
1934 4-5 3
1934 5-6 3
1935 4-5 9
1935 5-6 3
1935 6-7 2
1936 4-5 13
1936 5-6 5
1937 4-5 6
1937 5-6 1
1938 4-5 12
1938 5-6 1
1938 6-7 1
1939 4-5 9
1939 5-6 10
1939 6-7 1
1939 7-8 1
1940 4-5 15
1940 5-6 7
1940 6-7 1
1941 4-5 5
1941 5-6 11
1942 4-5 3
1942 5-6 8
1942 6-7 2
1943 4-5 8
1943 5-6 5
1943 6-7 1
1943 7-8 1
1944 4-5 4
1944 5-6 15
1944 6-7 1
1944 7-8 1
1945 4-5 7
1945 5-6 6
1946 4-5 3
1946 5-6 4
1947 4-5 4
1947 5-6 1
1948 4-5 9
1948 5-6 2
1949 4-5 8
1949 5-6 6
1949 6-7 2
1950 4-5 10
1950 5-6 2
1951 4-5 12
1951 5-6 2
1951 6-7 1
1952 4-5 14
1952 5-6 4
1953 4-5 30
1953 5-6 6
1953 7-8 1
1954 4-5 18
1954 5-6 4
1955 4-5 5
1955 5-6 2
1955 6-7 1
1956 4-5 25
1956 5-6 11
1956 6-7 2
1956 7-8 1
1957 4-5 19
1957 5-6 9
1957 6-7 1
1957 7-8 2
1958 4-5 16
1958 5-6 6
1959 4-5 22
1959 5-6 8
1960 4-5 20
1960 5-6 2
1961 4-5 11
1961 5-6 4
1961 6-7 1
1962 4-5 8
1962 5-6 4
1963 4-5 9
1963 5-6 5
1963 6-7 1
1964 4-5 37
1964 5-6 3
1964 6-7 1
1965 4-5 40
1965 5-6 6
1966 4-5 68
1966 5-6 8
1966 6-7 2
1967 4-5 89
1967 5-6 7
1967 6-7 1
1968 4-5 91
1968 5-6 6
1968 6-7 1
1969 4-5 97
1969 5-6 9
1969 6-7 2
1970 4-5 242
1970 5-6 20
1970 7-8 1
1971 4-5 126
1971 5-6 9
1971 6-7 1
1972 4-5 50
1972 5-6 1
1973 4-5 43
1974 4-5 54
1974 5-6 1
1975 4-5 73
1975 5-6 3
1975 6-7 1
1976 4-5 98
1976 5-6 7
1976 6-7 1
1977 4-5 55
1977 5-6 7
1978 4-5 47
1978 5-6 2
1979 4-5 44
1979 5-6 7
1980 4-5 51
1980 5-6 4
1980 6-7 1
1981 4-5 57
1981 5-6 1
1982 4-5 88
1982 5-6 1
1983 4-5 95
1983 5-6 4
1983 6-7 2
1984 4-5 106
1984 5-6 3
1985 4-5 70
1985 5-6 1
1986 4-5 85
1986 5-6 4
1987 4-5 79
1987 5-6 2
1988 4-5 73
1988 5-6 4
1988 6-7 1
1989 4-5 65
1989 5-6 6
1990 4-5 99
1990 5-6 3
1991 4-5 76
1991 5-6 7
1992 4-5 83
1992 5-6 3
1992 6-7 1
1993 4-5 53
1993 5-6 1
1994 4-5 60
1994 5-6 4
1995 4-5 84
1995 5-6 4
1995 6-7 1
1996 4-5 143
1996 5-6 6
1996 6-7 1
1997 4-5 76
1997 5-6 4
1998 4-5 72
1998 5-6 5
1998 6-7 1
1999 4-5 228
1999 5-6 10
1999 7-8 2
2000 4-5 72
2000 5-6 5
2001 4-5 84
2001 5-6 3
2002 4-5 87
2002 5-6 3
2002 6-7 1
2003 4-5 93
2003 5-6 10
2003 6-7 1
2004 4-5 102
2004 5-6 12
2005 4-5 146
2005 5-6 15
2006 4-5 67
2007 4-5 117
2007 5-6 11
2008 4-5 105
2008 5-6 2
2008 6-7 1
2009 4-5 66
2009 5-6 3
2010 4-5 85
2010 5-6 5
2010 6-7 1
2011 4-5 282
2011 5-6 19
2011 7-8 1
2012 4-5 170
2012 5-6 4
2012 6-7 1
2013 4-5 82
2013 5-6 3
2014 4-5 94
2014 5-6 3
2015 4-5 78
2015 5-6 2
2016 4-5 59
2016 5-6 2
2017 4-5 152
2017 5-6 9
2017 6-7 2
2018 4-5 64
2018 5-6 2
2019 4-5 85
2019 5-6 5
2020 4-5 39
2020 5-6 2
2020 6-7 1
year %>% ggplot(aes(Year, n))+
         geom_line(size=1, col="red")+
         scale_x_continuous(breaks=seq(min(year$Year),max(year$Year), 10))+
         ggtitle("Number of Earthquakes by Years") +
         xlab("Year") + ylab("Number of Cases")+
         labs(caption ="Data Source:AFAD (Disaster & Emergency Management Authority
                        Presidential of Earthquake Department)")+
         theme(plot.title = element_text(family = "Trebuchet MS", face="bold",                                                          size=14, hjust=0.5)) +
         theme(axis.title = element_text(family = "Trebuchet MS", face="bold",                                                          size=12))+
         geom_hline(yintercept=mean(year$n), linetype="twodash", color = "green",                                   size=1)
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Number of earthquakes by magnitude categories

total<-df2 %>% group_by(Magnitude_Class) %>% tally()

formattable(total)
Magnitude_Class n
4-5 5818
5-6 606
6-7 65
7-8 14

Density of earthquakes by years

df2 %>% ggplot(aes(Year, Magnitude, col=Magnitude_Class))+
        geom_point(size=1)+
        geom_jitter()+
        facet_grid(Magnitude_Class~., scale="free")+
        ggtitle("Density of Earthquakes of by Years")+
        xlab("Year") + ylab("Magnitude")+
        labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                       Presidential of Earthquake Department)")+
        theme(plot.title = element_text(family = "Trebuchet MS", face="bold",                                                          size=12, hjust=0.5)) +
        theme(axis.title = element_text(family = "Trebuchet MS", face="bold",                                                          size=10))
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Number of Earthquakes by Categories

df2 %>%  group_by(Year, Magnitude_Class) %>% tally() %>% 
         ggplot(aes(Year, n))+
         geom_point(size=1, col="red")+
         facet_wrap(~Magnitude_Class,  ncol=2, scales="free")+
         ggtitle("Number of Earthquake by Categories") +
         xlab("Year") + ylab("Number of Cases")+
         labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
         theme(plot.title = element_text(family = "Trebuchet MS", face="bold",                                                         size=14, hjust=0.5)) +
         theme(axis.title = element_text(family = "Trebuchet MS", face="bold",                                                         size=12))
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Total number of earthquakes by magnitude categories

year<-df2 %>% group_by(Magnitude_Class) %>% tally()

formattable (year)
Magnitude_Class n
4-5 5818
5-6 606
6-7 65
7-8 14

Number of cases by months

#Ordering by months
month<-df2 %>% group_by(Month) %>% tally()

formattable (month)
Month n
1 523
2 434
3 570
4 562
5 648
6 491
7 577
8 574
9 465
10 619
11 558
12 482
#Sorting number of cases from large to small by months
month<-month %>% select(Month, n) %>% arrange(desc(n))

formattable(month)
Month n
5 648
10 619
7 577
8 574
3 570
4 562
11 558
1 523
6 491
12 482
9 465
2 434
month %>% ggplot(aes(Month, n))+
          geom_line(size=1, col="brown")+
          scale_x_continuous(breaks=seq(1, 12, 1))+
          ggtitle("Number of Cases by Months") +
          xlab("Month") + ylab("Number of Cases")+
          labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
          theme(plot.title = element_text(family = "Trebuchet MS", face="bold",                                                         size=14, hjust=0.5)) +
          theme(axis.title = element_text(family = "Trebuchet MS", face="bold",                                                         size=12))+
          geom_hline(yintercept=mean(month$n), linetype="twodash", color = "red",                                    size=1)
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Number of earthquakes by categories and Months

m<-df2 %>% group_by(Month, Magnitude_Class) %>% tally()

formattable (m)
Month Magnitude_Class n
1 4-5 472
1 5-6 47
1 6-7 3
1 7-8 1
2 4-5 391
2 5-6 39
2 6-7 3
2 7-8 1
3 4-5 503
3 5-6 58
3 6-7 7
3 7-8 2
4 4-5 495
4 5-6 60
4 6-7 6
4 7-8 1
5 4-5 580
5 5-6 62
5 6-7 5
5 7-8 1
6 4-5 445
6 5-6 40
6 6-7 5
6 7-8 1
7 4-5 512
7 5-6 54
7 6-7 10
7 7-8 1
8 4-5 516
8 5-6 51
8 6-7 5
8 7-8 2
9 4-5 424
9 5-6 33
9 6-7 8
10 4-5 556
10 5-6 57
10 6-7 5
10 7-8 1
11 4-5 495
11 5-6 57
11 6-7 4
11 7-8 2
12 4-5 429
12 5-6 48
12 6-7 4
12 7-8 1
m %>% ggplot(aes(Month, n))+
      geom_point(size=1, col="red")+
      ggtitle("Number of Earthquakes by Categories and Months") +
      scale_x_continuous(breaks=seq(1, 12, 1))+
      xlab("Month") + ylab("Number of Cases")+
      labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                      Presidential of Earthquake Department)")+
      theme(plot.title = element_text(family = "Trebuchet MS", face="bold", size=14,                                                 hjust=0.5)) +
      theme(axis.title = element_text(family = "Trebuchet MS", face="bold",                                                          size=12))+
      geom_text_repel(aes(label=n), size=3, data=m)+
      theme(legend.position = "None")+
      facet_grid(Magnitude_Class~.)
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Number of earthquakes by time of day

#Sorting by time of day
hour<-df2 %>% group_by(Hour) %>% tally()

formattable (hour)
Hour n
0 347
1 271
2 296
3 272
4 277
5 279
6 246
7 263
8 253
9 268
10 265
11 273
12 242
13 242
14 265
15 257
16 274
17 277
18 274
19 263
20 281
21 276
22 288
23 254
#Sorting number of cases from large to small by time of day
hour<-hour %>% select(Hour, n)%>%
      arrange(desc(n))

formattable(hour)
Hour n
0 347
2 296
22 288
20 281
5 279
4 277
17 277
21 276
16 274
18 274
11 273
3 272
1 271
9 268
10 265
14 265
7 263
19 263
15 257
23 254
8 253
6 246
12 242
13 242
hour %>% ggplot(aes(Hour, n))+
         geom_line(size=1, col="red")+
         scale_x_continuous(breaks=seq(0, 24, 2))+
         ggtitle("Number of Cases by Hour") +
         xlab("Time") + ylab("Number of Cases")+
         labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
         theme(plot.title = element_text(family = "Trebuchet MS", face="bold",                                                         size=14, hjust=0.5)) +
         theme(axis.title = element_text(family = "Trebuchet MS", face="bold",                                                         size=12))+
         geom_hline(yintercept=mean(hour$n), linetype="twodash", color = "blue",                                    size=1)
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Number of earthquakes by categories and Hour

h<-df2 %>% group_by(Hour, Magnitude_Class) %>% tally()

formattable (h)
Hour Magnitude_Class n
0 4-5 317
0 5-6 24
0 6-7 5
0 7-8 1
1 4-5 246
1 5-6 23
1 6-7 1
1 7-8 1
2 4-5 273
2 5-6 19
2 6-7 3
2 7-8 1
3 4-5 237
3 5-6 31
3 6-7 2
3 7-8 2
4 4-5 259
4 5-6 17
4 6-7 1
5 4-5 248
5 5-6 29
5 6-7 2
6 4-5 217
6 5-6 25
6 6-7 2
6 7-8 2
7 4-5 225
7 5-6 34
7 6-7 4
8 4-5 233
8 5-6 18
8 6-7 2
9 4-5 238
9 5-6 28
9 6-7 2
10 4-5 235
10 5-6 27
10 6-7 2
10 7-8 1
11 4-5 243
11 5-6 28
11 6-7 2
12 4-5 210
12 5-6 26
12 6-7 6
13 4-5 212
13 5-6 29
13 6-7 1
14 4-5 239
14 5-6 21
14 6-7 5
15 4-5 230
15 5-6 24
15 6-7 3
16 4-5 249
16 5-6 20
16 6-7 4
16 7-8 1
17 4-5 244
17 5-6 30
17 6-7 3
18 4-5 250
18 5-6 22
18 6-7 2
19 4-5 233
19 5-6 26
19 6-7 2
19 7-8 2
20 4-5 245
20 5-6 32
20 6-7 4
21 4-5 245
21 5-6 28
21 6-7 2
21 7-8 1
22 4-5 263
22 5-6 22
22 6-7 2
22 7-8 1
23 4-5 227
23 5-6 23
23 6-7 3
23 7-8 1
h %>% ggplot(aes(Hour, n))+
      geom_point(size=1, col="red")+
      facet_wrap(~Magnitude_Class,  ncol=2, scales="free")+
      ggtitle("Number of Earthquakes by Categories") +
      xlab("Time") + ylab("Number of Cases")+
      labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                      Presidential of Earthquake Department)")+
      theme(plot.title = element_text(family = "Trebuchet MS", face="bold", size=14,                                                hjust=0.5)) +
      theme(axis.title = element_text(family = "Trebuchet MS", face="bold", size=12))
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

Map of earthquakes with magnitudes between 6.0 and 7.0 in Turkey

y<- df2 %>% filter(`Magnitude_Class` == "6-7")
    leaflet() %>% addTiles() %>%
    addCircles(data=y, radius = y$Magnitude, color = '#ff0000', fillOpacity = 4,                    weight=5)
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Map of earthquakes with magnitudes between 7.0 and 8.0 in Turkey

y <- df2 %>% filter(`Magnitude_Class` == "7-8")
     leaflet() %>% addTiles() %>%
     addCircles(data=y, radius = y$Magnitude, color = "blue", fillOpacity = 0.9,                     weight=6)
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Map of earthquakes with magnitudes between 5.0 and 6.0 in Turkey

y<- df2 %>% filter(`Magnitude_Class` == "5-6")
    leaflet() %>% addTiles() %>%
    addCircles(data=y, radius = y$Magnitude, color = "green", fillOpacity = 0.5,                    weight=5)
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Map of earthquakes with magnitudes between 4.0 and 5.0 in Turkey

y <- df2 %>% filter(`Magnitude_Class` == "4-5")
     leaflet() %>% addTiles() %>%
     addCircles(data=y, radius = y$Magnitude, color = "purple", fillOpacity = 0.1,                   weight = 1)
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Manisa earthquakes by magnitude

manisa<-df2 %>% filter(str_detect(Place, "Manisa"))
  
year<-manisa %>% group_by(Year, Month, Day, Hour, Minute, Magnitude, Depth) %>% 
                 tally()

formattable (year[,-8])
Year Month Day Hour Minute Magnitude Depth
1905 4 30 16 1 6.1 10
1942 10 28 2 22 6.0 50
1969 3 28 1 48 6.5 4
year %>% ggplot(aes(Year, Magnitude))+
         geom_point(size=2, col="red")+
         ggtitle("Manisa Earthquakes by Magnitude") +
         scale_x_continuous(breaks=seq(min(year$Year),max(year$Year), 7))+
         xlab("Year") + ylab("Magnitude")+
         labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
         theme(plot.title = element_text(face="bold", size=14, hjust=0.5))+         
         theme(axis.title = element_text(face="bold",size=12))+
         geom_text_repel(aes(label=paste("Magnitude:",Magnitude,",","Date:",Year,"/",                              Month,"/", Day,",", "Time:", Hour,":",Minute)), size=3,                              direction="y",fontface = 'bold', box.padding = unit(0.5,                              'lines'), point.padding = unit(1.6, 'lines'), arrow =                                arrow(length = unit(0.03,'npc')),                                                    segment.color="brown",segment.size = 0.5, hjust=0.5,                                 data=year)+
         theme(legend.position = "None")+
         theme(plot.caption = element_text(color = "blue", face="italic", hjust=0.5))

Map of Manisa earthquakes

  leaflet() %>%
  addTiles() %>%
  addMarkers(data=manisa,label=manisa$Magnitude,
             labelOptions = labelOptions(noHide =T))
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Erzincan earthquakes by magnitude

erzincan<-df2 %>% filter(str_detect(Place, "Erzican"))
  
year<-erzincan %>% group_by(Year, Month, Day, Hour, Minute, Magnitude, Depth) %>% 
                   tally()

formattable (year[,-8])
Year Month Day Hour Minute Magnitude Depth
1939 12 26 23 57 7.9 20.0
1949 8 17 18 44 6.7 40.0
1992 3 13 17 18 6.6 22.2
year %>% ggplot(aes(Year, Magnitude))+
         geom_point(size=2, col="red")+
         ggtitle("Erzincan Earthquakes by Magnitude") +
         scale_x_continuous(breaks=seq(min(year$Year),max(year$Year), 4))+
         xlab("Year") + ylab("Magnitude")+
         labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
         theme(plot.title = element_text(face="bold", size=14, hjust=0.5))+         
         theme(axis.title = element_text(face="bold",size=12))+
         geom_text_repel(aes(label=paste("Magnitude:",Magnitude,",","Date:",Year,"/",                              Month,"/", Day,",", "Time:", Hour,":",Minute)), size=3,                              direction="y",fontface = 'bold', box.padding = unit(0.5,                              'lines'), point.padding = unit(1.6, 'lines'), arrow =                                arrow(length = unit(0.03,'npc')),                                                    segment.color="brown",segment.size = 0.5, hjust=0.5,                                 data=year)+
         theme(legend.position = "None")+
         theme(plot.caption = element_text(color = "blue", face="italic", hjust=0.5))

Map of Erzincan earthquakes

leaflet() %>%
  addTiles() %>%
  addMarkers(data=erzincan,
             label=erzincan$Magnitude,
             labelOptions = labelOptions(noHide = T))
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Van earthquakes by magnitude

van<-df2 %>% filter(str_detect(Place, "Van"))
  
year<-van %>% group_by(Year, Month, Day, Hour, Minute, Magnitude, Depth) %>% 
                   tally()

formattable (year[,-8])
Year Month Day Hour Minute Magnitude Depth
1976 11 24 12 22 7.0 8.60
2011 10 23 10 41 7.1 19.02
2011 10 23 20 45 6.0 6.79
year %>% ggplot(aes(Year, Magnitude))+
         geom_point(size=2, col="red")+
         ggtitle("Van Earthquakes by Magnitude") +
         scale_x_continuous(breaks=seq(min(year$Year),max(year$Year), 5))+
         xlab("Year") + ylab("Magnitude")+
         labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
         theme(plot.title = element_text(face="bold", size=14, hjust=0.5))+         
         theme(axis.title = element_text(face="bold",size=12))+
         geom_text_repel(aes(label=paste("Magnitude:",Magnitude,",","Date:",Year,"/",                              Month,"/", Day,",", "Time:", Hour,":",Minute)), size=3,                              direction="y",fontface = 'bold', box.padding = unit(0.5,                              'lines'), point.padding = unit(1.6, 'lines'), arrow =                                arrow(length = unit(0.03,'npc')),                                                    segment.color="brown",segment.size = 0.5, hjust=0.5,                                 data=year)+
         theme(legend.position = "None")+
         theme(plot.caption = element_text(color = "blue", face="italic", hjust=0.5))

Map of Van earthquakes

leaflet() %>%
  addTiles() %>%
  addMarkers(data=van,
             label=van$Magnitude,
             labelOptions = labelOptions(noHide = T))
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Malatya earthquakes by magnitude

malatya<-df2 %>% filter(str_detect(Place, "Malatya"))
  
year<-malatya %>% group_by(Year, Month, Day, Hour, Minute, Magnitude, Depth) %>% 
                   tally()

formattable (year[,-8])
Year Month Day Hour Minute Magnitude Depth
1905 12 4 7 4 6.8 10
1908 9 28 6 27 6.1 10
year %>% ggplot(aes(Year, Magnitude))+
         geom_point(size=2, col="red")+
         ggtitle("Malatya Earthquakes by Magnitude") +
         scale_x_continuous(breaks=seq(min(year$Year),max(year$Year), 1))+
         xlab("Year") + ylab("Magnitude")+
         labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
         theme(plot.title = element_text(face="bold", size=14, hjust=0.5))+         
         theme(axis.title = element_text(face="bold",size=12))+
         geom_text_repel(aes(label=paste("Magnitude:",Magnitude,",","Date:",Year,"/",                              Month,"/", Day,",", "Time:", Hour,":",Minute)), size=3,                              direction="y",fontface = 'bold', box.padding = unit(0.5,                              'lines'), point.padding = unit(1.6, 'lines'), arrow =                                arrow(length = unit(0.03,'npc')),                                                    segment.color="brown",segment.size = 0.5, hjust=0.5,                                 data=year)+
         theme(legend.position = "None")+
         theme(plot.caption = element_text(color = "blue", face="italic", hjust=0.5))

Map of Malatya earthquakes

leaflet() %>%
  addTiles() %>%
  addMarkers(data=malatya,
             label=malatya$Magnitude,
             labelOptions = labelOptions(noHide = T))
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Kocaeli earthquakes by magnitude

kocaeli<-df2 %>% filter(str_detect(Place, "Kocaeli"))
  
year<-kocaeli %>% group_by(Year, Month, Day, Hour, Minute, Magnitude, Depth) %>% 
                  tally()

formattable (year[,-8])
Year Month Day Hour Minute Magnitude Depth
1999 8 17 0 1 7.6 15

Map of Kocaeli earthquakes

leaflet() %>%
  addTiles() %>%
  addMarkers(data=kocaeli,
             label=paste("Magnitude:",kocaeli$Magnitude,",","Date:",kocaeli$Year,"/",              kocaeli$Month,"/", kocaeli$Day,",", "Time:",kocaeli$Hour,":",                        kocaeli$Minute),
             labelOptions = labelOptions(noHide = T, direction = 'bottom'))
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Muş earthquakes by magnitude

mus<-df2 %>% filter(str_detect(Place, "Malazgirit-Mu?|Varto-Mu?"))
  
year<-mus %>% group_by(Year, Month, Day, Hour, Minute, Magnitude, Depth) %>% 
                  tally()

formattable (year[,-8])
Year Month Day Hour Minute Magnitude Depth
1903 4 28 23 46 6.3 30
1966 8 19 12 22 6.9 26
year %>% ggplot(aes(Year, Magnitude))+
         geom_point(size=2, col="red")+
         ggtitle("Muş Earthquakes by Magnitude") +
         scale_x_continuous(breaks=seq(min(year$Year),max(year$Year), 12))+
         xlab("Year") + ylab("Magnitude")+
         labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority
                         Presidential of Earthquake Department)")+
         theme(plot.title = element_text(face="bold", size=14, hjust=0.5))+         
         theme(axis.title = element_text(face="bold",size=12))+
         geom_text_repel(aes(label=paste("Magnitude:",Magnitude,",","Date:",Year,"/",                              Month,"/", Day,",", "Time:", Hour,":",Minute)), size=3,                              direction="y",fontface = 'bold', box.padding = unit(0.5,                              'lines'), point.padding = unit(1.6, 'lines'), arrow =                                arrow(length = unit(0.03,'npc')),                                                    segment.color="brown",segment.size = 0.5, hjust=0.5,                                 data=year)+
         theme(legend.position = "None")+
         theme(plot.caption = element_text(color = "blue", face="italic", hjust=0.5))

Map of Muş earthquakes

  leaflet() %>%
  addTiles() %>%
  addCircleMarkers(data=mus,
                   label=paste("Magnitude:",mus$Magnitude,",","Date:",mus$Year,"/",
                                mus$Month,"/",mus$Day,",", "Time:",                                                  mus$Hour,":",mus$Minute),
                   labelOptions = labelOptions(noHide = T, direction = 'bottom'))
## Assuming "Longitude" and "Latitude" are longitude and latitude, respectively

Depths of Turkey Earthquakes from 1900 to 2020 by Magnitude Category

df2 %>% ggplot(aes(x = Depth, y = Magnitude_Class, fill = stat(x))) +
        geom_density_ridges_gradient(scale = 3, rel_min_height = 0.01, gradient_lwd =                                      1.) +
        scale_fill_viridis_c(name = "Depth", option = "B") +
        labs(title = 'Depths of Turkey Earthquakes',
             subtitle = 'Depths of Turkey Earthquakes from 1900 to 2020 by Magnitude Category') +
        theme_ridges(font_size = 11, grid = TRUE) + 
        theme(axis.title.y = element_blank())+
        labs(caption = "Data Source:AFAD (Disaster & Emergency Management Authority Presidential of Earthquake Department)")+
        theme(plot.caption = element_text(color = "blue", face="italic", hjust=0.5))
## Picking joint bandwidth of 4.61

Kolmogorov-Smirnov Normality test

#Kolmogorov-Smirnov test is used in place of Shapiro-Wilk’s one because sample size exceeds 5000.

ks.test(df2$Magnitude, df2$Depth)
## Warning in ks.test(df2$Magnitude, df2$Depth): p-value will be approximate in the
## presence of ties
## 
##  Two-sample Kolmogorov-Smirnov test
## 
## data:  df2$Magnitude and df2$Depth
## D = 0.8899, p-value < 2.2e-16
## alternative hypothesis: two-sided

Correlation between depth of earthquakes and magnitude of earthquakes

ggscatter(df2, x = "Magnitude", y = "Depth", 
          add = "reg.line", conf.int = TRUE, 
          cor.coef = TRUE, cor.method = "pearson",
          xlab = "Magnitude", ylab = "Depth", main="Correlation between depth of earthquakes and magnitude of earthquakes")

Correlation Analysis

#There is no strong correlation between depth of earthquakes and magnitude of earthquakes.
cor.test(df2$Magnitude, df2$Depth, 
                    method = "pearson")
## 
##  Pearson's product-moment correlation
## 
## data:  df2$Magnitude and df2$Depth
## t = 8.0523, df = 6501, p-value = 9.59e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.07525035 0.12338173
## sample estimates:
##        cor 
## 0.09937416

Conclusion

In this study, it is aimed to be conducted exploratory data analysis of Turkey earthquages using data mining techniques. From descriptive statistics, it is understood that earthquakes often show up at night and in the evening. It is observed that the eartquages with magnitudes ranging from 4.0 to 8.0 are more intense in ones between 10th and 12th months relative to other months.

The findings show that there is no strong correlation between depth of earthquages and magnitude of earthquages. Factors such as soil and rock structure may have affected this relationship. In addition, these factors need to be evaluated.

Hope to create awareness..

I attribute this study to people who died and were injured in the earthquake.

References

https://deprem.afad.gov.tr/depremkatalogu?lang=en

http://www.geo.mtu.edu/UPSeis/magnitude.html

https://tevfikbulut.com/2020/02/02/exploratory-data-analysis-of-turkey-earthquakes-ii/

https://rpubs.com/tevfik1461/Turkey

https://tevfikbulut.com/2020/01/31/exploratory-data-analysis-of-turkey-earthquakes/

https://www.r-project.org/

https://cran.r-project.org/web/packages/ggridges/vignettes/gallery.html

https://cfss.uchicago.edu/notes/raster-maps-with-ggmap/