Yes this helped a lot . I exactly followed what you suggested: X<-(82:92) ; Y<-(364:369) ##### for sellected region > extract <- double(365) > setwd("C:\\Users\\aalyaari\\Desktop\\New folder (10)\\") > listfile<-dir() > for (i in 1:365) { + conne <- file(listfile[i], "rb") + file1<- readBin(conne, double(), n=360*720) + file2<-matrix(data=file1,ncol=720,nrow=360) + extract[i]<-mean(file2[X,Y],na.rm=TRUE) + close(conne) + write.table(extract,"C:\\Users\\aalyaari\\Desktop\\New folder (10)\\samregion1.txt")}
But I wonder why I got all values like -3.75E+306 -1.30E+54 -1.22E+58 and the right ones should be like: 22.25 22.76 33.25 -- View this message in context: http://r.789695.n4.nabble.com/R-does-not-recognise-columns-and-rows-as-they-are-supposed-to-be-tp4631217p4631241.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.