library(plotly)Loading required package: ggplot2
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
# Simulated data
years <- 2000:2024
studies <- sample(5:30, length(years), replace = TRUE)
df <- data.frame(Year = years, Studies = studies)
plot_ly(df, x = ~Year, y = ~Studies, type = 'scatter', mode = 'lines+markers') %>%
layout(title = "Number of Mangrove Studies (2000–2024)",
xaxis = list(title = "Year"),
yaxis = list(title = "Number of Studies"))