2/12/2020

Quakes Dataset Viz Using Leaflet

pack_vec <- c("tidyr", "dplyr", "leaflet", "Hmisc")
sapply(pack_vec, require, character.only = TRUE)

Import Dataset & Check

Import quakes Dataset and transform it into tibble format. quakes dataset comes with base R. lat and long two variables are critical for creating upcoming Leatlet maps.

# A tibble: 2 x 5
    lat  long depth   mag stations
  <dbl> <dbl> <int> <dbl>    <int>
1 -20.4  182.   562   4.8       41
2 -20.6  181.   650   4.2       15

Quake Data Geographic Visualization

  • Two layers: CartoDB.Positron, and Esri.WorldTerrain.
  • Two marker style: Original Markers and Circle Markers colored by magnitude level.