I need some hints to do the pearson correlation (COR) test between years.
I want to get the analog years using a climate index, so I want to do COR of the last six months (sep 2019 to march 2020) with all the same period of the previous years from 1950 to 2019 and choose the years with higher correlation. Which could be the better way to do this?
If you can get the individual sequences of six months into a list, you can use one of the map functions from the purrr package to iterate along the list and calculate the correlations. In the example below, I invented some data to illustrate the idea.