I am trying to extract moving correlation values to begin creating a heat map of correlation values between mean annual temperature and ring-width values. When I try to run the dcc function I am given this error message "Error in x[1, 1]:x[dim(x)[1], 1] : NA/NaN argument" The dimensions are correct but in my ring-width data there is a hidden column that I cannot get rid of which I am assuming is the problem.
I tried the following code and it still did not work:
# perhaps the hidden column is just the row names? I extracted them
SPP.chrn.resid$Year <- as.numeric(rownames(SPP.chrn.resid))
# subset the data to match the temp data, so they have the same dimensions
SPP.chrn.resid_subset <- subset(SPP.chrn.resid, Year >= 1901 & Year <= 2018)
# removing extra data I dont need to match dimensions
SPP.chrn.resid_subset2 <- subset(SPP.chrn.resid_subset, select = -c(2))
# matching the temp data to make year the first column
SPP.chrn.resid_flipped <- SPP.chrn.resid_subset2[, c(2, 1)]
# Check for missing values
any(is.na(SPP.chrn.resid_subset))
any(is.na(SPP_tempmean))
# Check the dimensions and structure of the subsetted data frames
dim(SPP.chrn.resid_subset2)
dim(SPP_tempmean)`