Here I have created interactive visualizations using leaflet pakage in R. I have taken dataset of significant earthquakes between 1965 to 2016 from kaggle(https://www.kaggle.com/usgs/earthquake-database/data). This datset was compiled by National Earthquake Information Center (NEIC). This dataset includes a record of the date, time, location, depth, magnitude, and source of every earthquake with a reported magnitude 5.5 or higher since 1965.

Interactive Clusters of Earthquake Prone Zones

shake %>%
  leaflet() %>%
  addTiles() %>%
  addMarkers(~Longitude,~Latitude,clusterOptions =  markerClusterOptions(maxClusterRadius=40))

Marking Exact Locations of Earthquakes

shake %>%
  leaflet() %>%
  addTiles() %>%
  addCircles(~Longitude,~Latitude,radius = 10,color = "blue")

Earthquakes Clustered by Magnitude

shake %>%
  leaflet() %>%
  addTiles() %>%
  addCircles(~Longitude, ~Latitude,radius = ~ifelse(Magnitude < 6, 5,ifelse(Magnitude < 7, 10,ifelse(Magnitude < 8, 20, 30))),
             color = ~ifelse(Magnitude < 6, "green", ifelse(Magnitude < 7,"yellow",ifelse(Magnitude < 8,"blue","red"))))

Earthquakes of Class Great(Magnitude>=8)

super_shake<-subset(shake,shake$Magnitude>=8)
super_shake$label <- paste('Earthquake Date: ',super_shake$Date)

super_shake %>%
  leaflet() %>%
  addTiles() %>%
  addAwesomeMarkers(~Longitude, ~Latitude,label=~as.character(label))

Earthquakes Frequency by Year(Top 10)

shake$Date<-as.Date(shake$Date, format = "%m/%d/%Y")
shake$Year<-format(as.Date(shake$Date, format="%d/%m/%Y"),"%Y")

temp <- shake %>% group_by(Year) %>% summarise(n=n()) %>% arrange(desc(n)) %>% head(10)
temp %>%    
  ggplot(aes(x =reorder(Year,n), y =  n )) +
  geom_bar(stat='identity',colour="white", fill = c("blue")) +
  labs(x = 'Year', y = 'Count', title = 'Top 10 Years with Highest Earthquake Frequency') +
  coord_flip() + 
  theme_bw()

Visualising Earthquakes in Most Active Year(2011)

shakes_2011<-subset(shake,shake$Year==2011)

shakes_2011 %>%
  leaflet() %>%
  addTiles() %>%
  addCircles(~Longitude,~Latitude,radius = 10,color = "blue")

HeatMaps of Earthquakes

leaflet(shake) %>% addProviderTiles(providers$CartoDB.DarkMatter) %>%
  addWebGLHeatmap(lng=~Longitude, lat=~Latitude, size = 100000)


leaflet(shake) %>% addProviderTiles(providers$CartoDB.DarkMatter) %>%
  addWebGLHeatmap(lng=~Longitude, lat=~Latitude, intensity = ~Magnitude, size=60000)

Refrences:

  1. Leaflet for R: https://rstudio.github.io/leaflet/
  2. US Geological Survey: https://www.usgs.gov/
  3. Kaggle: https://www.kaggle.com/