Rainfall patterns play a crucial role in understanding Ireland’s climate, which is known for its variability and abundant precipitation. This project examines monthly rainfall trends from four prominent weather stations across the country: Belfast, Dublin Airport, University College Galway, and Cork Airport. These stations represent a diverse geographical spread, capturing rainfall characteristics across northern, eastern, western, and southern Ireland.
Using an interactive dygraph, we visualize rainfall data from January 1850 to December 2014, providing a dynamic tool for exploring temporal trends. The dygraph allows users to analyze both seasonal variations and long-term trends while offering a RangeSelector control, enabling simultaneous adjustments of the time window for all four stations. This feature is particularly useful for comparing rainfall patterns across regions over specific periods, shedding light on the spatial and temporal variability of rainfall in Ireland.
The rainfall dataset encompasses over a century and a half of monthly rainfall measurements from multiple weather stations across Ireland, spanning from January 1850 to December 2014. It serves as a valuable resource for analysing historical precipitation patterns and understanding how they differ across regions and time periods.
The dataset contains the following key columns:
This project focuses on the four selected stations: Belfast, Dublin Airport, University College Galway, and Cork Airport, chosen for their geographical diversity and significance in representing Ireland’s climate regions.
# Loading Libraries and Data
library(dygraphs)
library(xts)
library(dplyr)
library(sf)
library(tidyr)
library(htmlwidgets)
library(lubridate)
setwd("~/Desktop/GY672[A] - R")
#Load rainfall data
load("rainfall.RData")
#Define the stations of interest
selected_stations <- c("Dublin Airport", "University College Galway", "Belfast", "Cork Airport")
#Filter rainfall data for the selected stations
filtered_data <- rain %>%
filter(Station %in% selected_stations) %>%
mutate(
Date = make_date(Year, match(Month, month.abb), 1)
)
#Pivot the data to wide format for dygraph
rainfall_xts <- filtered_data %>%
select(Date, Station, Rainfall) %>%
pivot_wider(names_from = Station, values_from = Rainfall) %>%
as.data.frame()
#Convert the dataframe to an xts object
rainfall_xts <- xts(rainfall_xts[, -1], order.by = rainfall_xts$Date)
#Create the dygraph
# Create the dygraph
rainfall_dygraph <- dygraph(rainfall_xts, main = "Monthly Rainfall in Ireland, 1850-2014") %>%
dyAxis("y", label = "Rainfall (mm)") %>%
dySeries("Belfast", color = "#00BFFF") %>%
dySeries("Dublin Airport", color = "#008B00") %>%
dySeries("University College Galway", color = "#AB82FF") %>%
dySeries("Cork Airport", color = "#CD2626") %>%
dyRangeSelector()
#Render the dygraph
print(rainfall_dygraph)
#Save the dygraph as an HTML file
library(htmlwidgets)
saveWidget(rainfall_dygraph, "rainfall_dygraph.html", selfcontained = TRUE)
Click here to view the interactive dygraph showing monthly rainfall trends.
Seasonal Patterns
The dygraph indicates clear seasonal fluctuations in rainfall levels. Rainfall tends to peak during the winter months (November–January), particularly in stations such as Cork Airport and University College Galway, while it drops to lower levels during the summer months (May–August).
Regional Variations
Cork Airport (red line): Consistently records the highest rainfall levels among the four stations, with frequent monthly peaks exceeding 300 mm.
Belfast (blue line): Demonstrates relatively moderate rainfall levels compared to Cork Airport, but still exhibits occasional spikes, especially in winter.
Dublin Airport (green line): Displays the lowest rainfall levels, remaining significantly below other stations throughout most of the time period.
University College Galway (purple line): Records rainfall levels closer to Cork Airport but with less pronounced spikes.
Year-to-Year Variations
The dygraph also shows notable interannual variability. While some years experience consistent rainfall across all stations, others show marked differences, such as particularly high peaks at Cork Airport. Periods of extreme rainfall are more frequent in the earlier part of the time series (pre-1900).
The interactive dygraph reveals distinct seasonal and regional rainfall patterns across the four stations, underscoring Ireland’s diverse precipitation characteristics. The ability to dynamically adjust the time window highlights the importance of long-term observations for identifying trends and extremes. The analysis emphasises Cork Airport’s tendency for heavy rainfall events and Dublin Airport’s drier conditions, providing valuable insights into Ireland’s climate variability.
This project is submitted as part of module GY672[A] - Analysing Spatial and Temporal Data Using R (2024-25: Semester 1), Maynooth University.