I have two directories. I used the code given below to calculate the spatial correlation between these files and it worked well. So basically I want to tell R:
even if there is NA between two pixels(in the two files), it shall ignore it but calculate for the rest (11 pixels).
for(i in 1:length(dir1)){
file_tot[,,i,1] <- dir1[i], numeric(), size = 4 , signed = T
file_tot[,,i,2] <- dir2[i], numeric(), size = 4 , signed = T
}
In
corby defaultuse="everything", which includesNA. Read?cor, specifically theuseargument to determine which value you should set it to for your particular situation.