temp <- file("path to my file", "rb")
temp2 <- file("path to my file", "rb")
temp5 <- file("path to my file", "rb")

ndvi <- array(readBin(temp, numeric(), n=209160900, size = 4), dim=c(414180,505))
dndvi <- array(readBin(temp2, numeric(), n=209160900, size = 4), dim=c(414180,505))
ppt20 <- array(readBin(temp5, numeric(), n=209160900, size = 4), dim=c(414180,505))

rm(temp)
rm(temp2)
rm(temp5)

array1 <- array(c(ndvi, dndvi,ppt20), dim=c(414180,1515))

rm(ndvi)
rm(dndvi)
rm(ppt20)


write.table(array1, file="SOM.txt",append=FALSE,quote=FALSE,sep=" ",eol="\n",na="NA",row.names=FALSE,col.names=FALSE)
rm(array1)
