I want to calculate the correlation between two stacks of rasters. For the correlation I am following this code here: https://www.reddit.com/r/rstats/comments/8c4tnv/correlation