I have 4 rasters and I calculated the correlation matrix with this code; but I need to know the p-value and I haven't been able to do it. Can you help me?
a<-stack(FS2,FP2,W2,P)
jnk=layerStats(a, 'pearson', na.rm=T)
corr_matrix=jnk$'pearson correlation coefficient'