R code used to create NAO indices (fig. 5)

Set working directory

setwd("G:/Thesis data")
getwd()
## [1] "G:/Thesis data"

Load data

NAO_ts <- read.csv("NAO Timeseries 1856-2014.csv")

Convert data from monthly means to annual means

First remove year column

Years <- NAO_ts$YEAR

And the monthly data

Months <- NAO_ts[2:13]

Replace missing values (-99.99) with NA

Months[Months==-99.99] <- NA

Get annual means

NAO_ts_anmean <- rowMeans(Months,na.rm = FALSE)

Now join to Years again

NAO_ts_anmean <- data.frame(Years, NAO_ts_anmean)

NAO within AMO positive phase (1925-1965)

NAO_ts_2565 <- NAO_ts_anmean[70:110, ]
plot(NAO_ts_2565, type='l',xlab='Year',ylab= 'NAO (pressure deviation)',
     main='NAO timeseries 1925-1965')

##############################################################################

NAO within AMO negative phase (1966-1995)

NAO_ts_6695 <- NAO_ts_anmean[111:140, ]
plot(NAO_ts_6695, type='l',xlab='Year',ylab= 'NAO (pressure deviation)',
     main='NAO timeseries 1966-1995')