Thanks you meant it shoud be: file1=do.call(rbind, lapply(dir1, readBin, integer(), size = 2, n = 360 * 720, signed = T)) file2=do.call(rbind, lapply(dir2, readBin, integer(), size = 2, n = 360 * 720, signed = T)) Please see the error > for (.f in seq_along(dir1)){ + results[[.f]]<- cor(file1[, .f] ,file2[, .f]) + } Error in file2[, .f] : incorrect number of dimensions
-- View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-the-spatial-correlation-of-several-files-tp4651888p4651901.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.