Analyze All Station Pairs
analyze_station_pairs.RdComputes cross-correlations for all unique station pairs.
Value
Data frame with one row per station pair containing:
station1, station2: station pair
distance_km: distance between stations
optimal_lag: lag with max correlation
max_correlation: correlation at optimal lag
expected_lag: expected lag based on wave propagation (~30 km/h)
Examples
if (FALSE) { # \dontrun{
data <- data.frame(
time = rep(seq(as.POSIXct("2024-01-01"), by = "hour", length.out = 100), 2),
station_id = rep(c("M2", "M3"), each = 100),
wave_height = c(rnorm(100, 3, 1), rnorm(100, 2.5, 0.8))
)
analyze_station_pairs(data)
} # }