Skip to content

Commit

Permalink
remove spatial distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnumds committed Dec 13, 2024
1 parent f120062 commit 1eea0a2
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -181,44 +181,6 @@ print(region)

The spatial distribution of earthquakes provides valuable insights into where seismic activity is concentrated across the globe. By analyzing earthquake locations and clustering patterns, we can identify tectonic hotspots, understand fault line behaviors, and prioritize regions for disaster preparedness.

```{r}
# Check and set CRS for 'quake_sf'
if (is.na(st_crs(quake_sf))) {
st_crs(quake_sf) <- 4326 # Assign WGS84 CRS
}
# Check and set CRS for 'world'
if (is.na(st_crs(world))) {
st_crs(world) <- 4326 # Assign WGS84 CRS
}
# Ensure CRS consistency
if (st_crs(quake_sf) != st_crs(world)) {
quake_sf <- st_transform(quake_sf, st_crs(world))
}
# Extract coordinates for plotting
quake_coords <- as.data.frame(st_coordinates(quake_sf)) %>%
cbind(mag = quake_sf$mag) # Combine coordinates with magnitude
# Plot earthquake locations
ggplot() +
geom_sf(data = world, fill = "lightgray", color = "white") +
geom_point(
data = quake_coords,
aes(x = X, y = Y, color = mag),
alpha = 0.7, size = 1
) +
scale_color_viridis_c(option = "plasma", name = "Magnitude") +
theme_minimal() +
labs(
title = "Spatial Distribution of Earthquakes (1980-2020)",
x = "Longitude",
y = "Latitude"
)
```

## Earthquake Trends Over Time

```{r}
Expand Down

0 comments on commit 1eea0a2

Please sign in to comment.