Partial Correlation of stacked rasters

Hi, See the FAQ: How to do a minimal reproducible example reprex for beginners to help give the community some traction. The code and data for the smaller area will help replicate the issue. 3.2e7 isn't all that big, so long as the function to do the calculation isn't trying to grow an object that hasn't been pre-allocated.