dotted y intercept line in ggplot

# Install and load required packages
install.packages("ggplot2")
library(ggplot2)

# Create a sample dataset
data <- data.frame(x = 1:10, y = 2 * (1:10) + rnorm(10))

# Create a scatter plot with a dotted y-intercept line
ggplot(data, aes(x, y)) +
  geom_point() +
  geom_hline(yintercept = 0, linetype = "dotted", color = "red") +
  labs(title = "Scatter Plot with Dotted Y-Intercept Line", 
       x = "X-axis Label", y = "Y-axis Label")