This is now updated to include the North Pacific Current Bifurcation Index (bi). And was re-run on the above date to update all indices.
library(pacea)
library(tibble) # Else prints all of a tibbleVarious climate and oceanographic indices are included in pacea. For example, to see a plot of the Oceanic Niño Index (ONI) anomaly, simply type
plot(oni)This shows the onset of El Niño (positive index) conditions in April 2023.
The values are readily available:
oni# # A tibble: 897 × 4
# year month value anomaly
# <dbl> <dbl> <dbl> <dbl>
# 1 1950 1 24.7 -1.53
# 2 1950 2 25.2 -1.34
# 3 1950 3 25.8 -1.16
# 4 1950 4 26.1 -1.18
# 5 1950 5 26.3 -1.07
# 6 1950 6 26.3 -0.85
# 7 1950 7 26.2 -0.54
# 8 1950 8 26.0 -0.42
# 9 1950 9 25.8 -0.39
# 10 1950 10 25.6 -0.44
# # ℹ 887 more rows
tail(oni)# # A tibble: 6 × 4
# year month value anomaly
# <dbl> <dbl> <dbl> <dbl>
# 1 2024 4 28.4 0.71
# 2 2024 5 28.2 0.4
# 3 2024 6 27.8 0.15
# 4 2024 7 27.3 0.04
# 5 2024 8 26.8 -0.11
# 6 2024 9 26.6 -0.22
so you can use them to conduct your own analyses.
Each climatic and oceanographic index is saved as a data object, and properly documented, described, and referenced in its help file, accessed by, for example:
?oni # output not shown in vignetteThe object oni has the class pacea_index, which ensures that the plot(oni) command above automatically uses our specialised function plot.pacea_index(oni) that gives the red and blue colouring, tickmarks, and axis labelling. See ?plot.pacea_index for many options to further customise the figure and change it from the default shown above; any arguments not listed will get passed onto the standard plot(...) function. A few examples are shown below, including xlim which is a little more tricky as it has to be specified as a date object (as noted in ?plot.pacea_index):
plot(oni,
xlim = c(lubridate::dmy(01011950), # day-month-year
lubridate::dmy(01012048)),
xaxs = "i",
main = "My customised title",
lwd = 2)You can easily see if some occasional event seems to correspond with El Niño, by specifying the event_years argument (we also truncate the time axis here):
plot(oni,
event_years = c(1996, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2014, 2016, 2017, 2019),
xlim = c(lubridate::dmy(01011995),
lubridate::dmy(01012024)),
lwd = 2)For this example (inspired by a conversation about a rare sighting of a Bluntnose Sixgill Shark near Port Alberni, see ?plot.pacea_index for full details), the grey dots show the years of the event (shark sighting) and the oni value; there looks to be no clear relationship between the shark sightings and El Niño. This gives a quick way to test an idea, and decide whether to pursue a more detailed analysis. The event_lub argument can be specified to give exact dates (rather than just years).
Important: if using oni, when you read ?oni [hint hint] you will see that values for the last two months may change in subsequent updates. For this reason, and in general for all indices, when conducting analyses you may wish to restrict an analysis to a specified time period, else your results will change if you update pacea and the indices have been updated. For example,
oni_fix <- dplyr::filter(oni,
year < 2023 | year == 2023 & month < 3)
tail(oni_fix) # Should always end with February 2023# # A tibble: 6 × 4
# year month value anomaly
# <dbl> <dbl> <dbl> <dbl>
# 1 2022 9 25.8 -1.01
# 2 2022 10 25.7 -0.99
# 3 2022 11 25.8 -0.92
# 4 2022 12 25.8 -0.83
# 5 2023 1 26.0 -0.68
# 6 2023 2 26.4 -0.43
Of course, you may always want an analysis to be as up-to-date as possible, but be aware of this for reproducibility, and to avoid you being confused if your results slightly change. Similar, for pdo the previous last value can seem to get updated.
The indices currently imported into pacea, ordered by start year, are:
knitr::kable(pacea_indices)| Object | Description | Resolution | Start year | End year |
|---|---|---|---|---|
| pdo | Pacific Decadal Oscillation | monthly | 1854 | 2024 |
| npi_monthly | North Pacific Index (monthly) | monthly | 1899 | 2024 |
| npi_annual | North Pacific Index (annual) | annual | 1899 | 2024 |
| alpi | Aleutian Low Pressure Index | annual | 1900 | 2022 |
| oni | Oceanic Niño Index | monthly | 1950 | 2024 |
| npgo | North Pacific Gyre Oscillation | monthly | 1950 | 2024 |
| ao | Arctic Oscillation | monthly | 1950 | 2024 |
| soi | Southern Oscillation Index | monthly | 1951 | 2024 |
| bi | North Pacific Bifurcation Index | annual | 1967 | 2024 |
| mei | Multivariate El Niño Southern Oscillation Index | monthly | 1979 | 2024 |
For further details and references for each one see its help file, e.g. ?pdo. See the main README file for our plan on updating these (and other) objects in pacea.
Some indices contain absolute values as well as anomalies, for which the value and style options should be set:
plot(npi_annual,
value = "value", # plot the absolute value, not the anomaly
style = "plain", # plot a plain line, not the red-blue style
ylab = "North Pacific Index (absolute, hPa)") # Refine labelTo smooth monthly values over a year:
plot(oni,
smooth_over_year = TRUE,
lwd = 6) # You may have to tweak the line thickness to suit your figureThe corresponding date plotted is (centred around) 1st January for each year.
For a line with filled-in colouring for red above 0 and blue below (as opposed the bars shown so far):
plot(oni,
style = "red_blue")Here are the plots of all the indices listed above, over their default ranges without any smoothing over the year (for the monthly indices). The lwd arguments should be tweaked for specific applications and publications so that red and blue do not overlap – this depends on size of the final figure, so is best done manually be the user. In particular the plot for the (over 2000) monthly values for pdo would need some tweaking. Note that npi_monthly is saved as an absolute value, so the arguments have to be specified, as per the example in ?npi_monthly.
par(mfrow = c(nrow(pacea_indices), 1))
lwd_val = 3
plot(pdo)
plot(npi_monthly,
value = "value", # plot the absolute value as no anomaly defined
style = "plain", # plot a plain line, not the red-blue style
ylab = "North Pacific Index (absolute, hPa)") # Refine label
plot(npi_annual,
lwd = lwd_val)
plot(alpi,
lwd = lwd_val)
plot(oni)
plot(npgo)
plot(ao)
plot(soi)
plot(bi,
lwd = lwd_val)
plot(mei)Here is a similar plot but showing each index over the same range of dates (to get an easy visualisation of availability of each index), and smoothed over the year for the monthly values (further tweaking is possible):
par(mfrow = c(nrow(pacea_indices) - 1, 1)) # Won't need npi_monthly as using npi_annual
full_years <- c(min(pacea_indices$`Start year`),
max(pacea_indices$`End year` + 1))
x_lim <- c(lubridate::dmy(paste0("0101", full_years[1])),
lubridate::dmy(paste0("0101", full_years[2])))
lwd_val = 2
plot(pdo,
xlim = x_lim,
smooth_over_year = TRUE,
lwd = lwd_val)
plot(npi_annual,
xlim = x_lim,
lwd = lwd_val)
plot(alpi,
xlim = x_lim,
lwd = lwd_val)
plot(oni,
xlim = x_lim,
smooth_over_year = TRUE,
lwd = lwd_val)
plot(npgo,
xlim = x_lim,
smooth_over_year = TRUE,
lwd = lwd_val)
plot(ao,
xlim = x_lim,
smooth_over_year = TRUE,
lwd = lwd_val)
plot(soi,
xlim = x_lim,
smooth_over_year = TRUE,
lwd = lwd_val)
plot(bi,
xlim = x_lim,
lwd = lwd_val)
plot(mei,
xlim = x_lim,
smooth_over_year = TRUE,
lwd = lwd_val)We have not incorporated any specific analytical tools into pacea yet. For looking at relationships of such indices with fish recruitment (as estimated by stock assessments), we do intend to update and functionalise the methods developed in Appendix F of
Haigh, R., P.J. Starr, A.M. Edwards, J.R. King and J. Lecomte (2019). Stock assessment for Pacific Ocean Perch (Sebastes alutus) in Queen Charlotte Sound, British Columbia in 2017. DFO Canadian Science Advisory Secretariat Research Document 2018/038. v + 227 p. http://www.dfo-mpo.gc.ca/csas-sccs/Publications/ResDocs-DocRech/2018/2018_038-eng.pdf
In that we utilised some of the indices now contained in pacea. By functionalising the methods we would hope to make such methods and analyses more operational (rather than stand-alone one-off projects). Let us know if this is of interest for your own analyses.