Dear community, I am getting this error from lmgrid: Error in empt[i, 1:(layers/2)] <- as.numeric(lm(mtrx[i, 1:(layers/2)] ~ : number of items to replace is not a multiple of replacement length Any I dea on what could be the problem? Thanks for your help John [[alternative HTML version deleted]]