Week 2 Assignment

Created on 2017-02-03.

Plot of earthquake activity

Map shows the locations of 1000 seismic events of MB > 4.0. The events occurred in a cube near Fiji since 1964. Circle size is proportional to the magnitude.

data(quakes)

bin_palette = colorBin("Blues", quakes$depth, n = 10)

quakes %>%
  leaflet() %>%
  addTiles() %>%
  addCircleMarkers(weight = 1, radius = (quakes$mag-3)^2, color=bin_palette(quakes$depth), popup=paste0("Depth: ", quakes$depth, "<br/>Mag: ", quakes$mag)) %>%
  addLegend("bottomright", pal = bin_palette, values = quakes$depth,
    title = "Depth",
    opacity = 1
  )
## Assuming 'long' and 'lat' are longitude and latitude, respectively