Week 6 Calvin Little

Week 6: Seismic Events on Mount Vesuvius

Single sentence story: “Where in this data set does frequent seismic activity occur, and how deep is that seismic activity from the surface?”

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.2     ✔ tibble    3.2.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.0.4     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(tidytuesdayR)
library(ggplot2)
library(gganimate)
No renderer backend detected. gganimate will default to writing frames to separate files
Consider installing:
- the `gifski` package for gif output
- the `av` package for video output
and restarting the R session

Download dataset from GitHub:

vesuvius <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-05-13/vesuvius.csv')
Rows: 12027 Columns: 11
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr  (3): area, type, review_level
dbl  (7): event_id, latitude, longitude, depth_km, duration_magnitude_md, md...
dttm (1): time

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(vesuvius)
# A tibble: 6 × 11
  event_id time                latitude longitude depth_km duration_magnitude_md
     <dbl> <dttm>                 <dbl>     <dbl>    <dbl>                 <dbl>
1     4251 2011-04-20 00:27:24     40.8      14.4     0.42                   1.2
2     4252 2012-06-19 21:29:48     40.8      14.4     1.31                   0.7
3    22547 2013-01-01 07:34:46     40.8      14.4     0.06                   2.2
4    22546 2013-01-03 16:06:48     NA        NA      NA                      0.2
5    22545 2013-01-03 16:07:37     NA        NA      NA                      0.2
6    22544 2013-01-04 06:42:50     NA        NA      NA                      0  
# ℹ 5 more variables: md_error <dbl>, area <chr>, type <chr>,
#   review_level <chr>, year <dbl>

Seismic Activity by latitude and longitude:

Looking at the recorded seismic activity around Mount Vesuvius, the apparent center of seismic action is at 14.43 longitude, 40.82 latitude.

ggplot(data=vesuvius, aes(x=longitude, y=latitude))+geom_point()
Warning: Removed 3433 rows containing missing values or values outside the scale range
(`geom_point()`).

ggplot(data=vesuvius, aes(x=longitude, y=latitude))+geom_bin2d()
Warning: Removed 3433 rows containing non-finite outside the scale range
(`stat_bin2d()`).

Seismic Activity by Magnitude and Depth

ggplot(data=vesuvius, aes(x=longitude, y=latitude, z=duration_magnitude_md))+geom_point(aes(size=duration_magnitude_md, color=depth_km))
Warning: Removed 3552 rows containing missing values or values outside the scale range
(`geom_point()`).