I have two binary files with the same dimensions: the first represents correlation between xm and df and the second represents also correlation between xm and gh data.I want to create one map out of these two representing the best correlations.for instance: 1- read the first pixel in the correlation map between xm and df and the corresponding pixel in the correlation map between xm and gh.
2- take the best correlation value and make it blue color if it comes from xm and df,otherwise make it green if it comes from xm and gh
3- do the same for all pixels
4- get something like the map associated
Here are the two files:
1- to read the first file correlation map:![enter image description here][1]
conn <- file("C:\\corr.bin","rb")![enter image description here][2]
corr<- readBin(conn, numeric(), size=4, n=1440*720, signed=TRUE)
y<-t(matrix((data=corr), ncol=720, nrow=1440))
image(y)
2- to read the second file land cover map:
conne <- file("C:\\cor06.bin","rb")
over<-readBin(conne, numeric(), size=4, n=1440*720, signed=TRUE)
y1<-t(matrix((data=over), ncol=720, nrow=1440))
image(y1)
3-to write the results:
to.write = file(paste("/orcomplete.bin",sep=""),"wb")
writeBin(as.double(results), to.write, size = 4)