Re: [R] read multiaple files within one folder

2012-04-06 Thread Amen
firstly , thanks a lot. yes the files are already binarys. (there are 360 binary files ,each file has dim of 720 *360 files) in one folder of what I am trying to do is to take the average of each 4 files and finally got 40 files to a new folder . the error message is Error in Testarray[i, , ] <

Re: [R] read multiaple files within one folder

2012-04-06 Thread jim holtman
Why "didn't seem to be right"? Are there error messages? I assume you have at least 6GB of real memory since you single copy of Testarray requires 3GB. Is your already in a 'binary' file? If so, why are you defining your matrix as numeric? Should you be using 'array(0L, dim = c(1460, 720, 360)

[R] read multiaple files within one folder

2012-04-06 Thread Amen
Suppose we have files in one folder file1.bin, file2.bin, ... , and 1460slice(file) with dim of 720 * 360 in directory C:\\PHD\\Climate Data\\Wind\\ and we want to read them and make a loop to go from 1 to 4 and take the average, then from 4 to 8 and so on till 1460. in the end we will get 365 f