I do apologize if this doesn’t look that good, my skills do not lie in design.

Quake Magnitude summary and visualization
summary(quakes %>% pluck("mag")) # Using %>% because typing | is a nightmare due to keyboard-related reasons
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   5.000   5.100   5.200   5.342   5.500   8.600

The mean, median, and 1st and 3rd quartile values are fairly close to the minimum recorded value - this is expected, as earthquakes with magnitudes greater than 6 are rare when compared to earthquakes with magnitude less than 6.

quakes %>% ggplot() + 
  geom_histogram(mapping = aes(x = mag), color = "white", bins=36) + #36 bins because 8.6-5.0 = 3.6
  geom_vline(xintercept = mean(quakes$mag), color = "blue") + 
  annotate("text", x = mean(quakes$mag) + 1, y = 1450, label = paste("Mean earthquake magnitude - ", mean(quakes$mag)), color = "blue") + 
  theme_classic()

As expected based on the values given by the summary, there is a very large difference in the number of observed earthquakes with magnitude less than 6 and the number of observed earthquakes with magnitude greater than 6 - with the number of observed earthquakes with magnitude greater than 7 being even smaller.

Quake type summary and visualization
types <- quakes %>% group_by(type) %>% summarize(n_types = n_distinct(type)) %>% arrange(desc(n_types)) %>% pluck("type")
quakes %>% filter((type %in% types)) %>%
  count(type)
## # A tibble: 3 × 2
##   type                  n
##   <chr>             <int>
## 1 earthquake        19941
## 2 nuclear explosion     4
## 3 volcanic eruption    55

The presence of four seismic events listed as being caused by nuclear explosions was somewhat unexpected - what exactly happened to cause those four events?

ggplot() + 
  geom_map(data = map_data("world"), map = map_data("world"), aes(map_id = region)) +
  geom_polygon(fill="white", colour = "black") +
  geom_point(size = 0.15, data = filter(quakes, type == "earthquake"), mapping = aes(x = longitude, y = latitude), color = "red") +
  geom_point(size = 0.15, data = filter(quakes, type == "volcanic eruption"), mapping = aes(x = longitude, y = latitude), color = "blue") +
  geom_point(size = 0.15, data = filter(quakes, type == "nuclear explosion"), mapping = aes(x = longitude, y = latitude), color = "green") + 
  theme_classic() #Wow this took too long and neat, you can see plate boundaries

The vast majority of earthquakes happened near tectonic plate boundaries, though some did occur elsewhere. It may be worth looking into what causes earthquakes in locations away from plate boundaries. It may also be worth looking into what locations experience more stronger earthquakes, or which plate boundaries experience earthquakes more frequently.

Questions

1 - What locations experience more earthquakes with a magnitude greater than 6?

2 - Along which plate boundaries do these earthquakes most frequently occur?

3 - On average, how many earthquakes with magnitude at least 5 occur each year?

  3b - On average, how many earthquakes with magnitude at least 6 and 7 occur each year?

4 - What caused the nuclear explosion-induced quakes?