Hi R-friends
   
  I need to read a big matrix (something like 1024000x1024) into 1000 small 
matrices. After that, I need write each small matrix (1024x1024) into a asc 
file, putting de index of matrix (1:1000) on the file name.
   
  I´m makint it by a hard and unelegant way:
   
  mat<-scan("file...")  # reading list
  mat_r001<-matrix(mat[1:1048576],1024,1024)  # here I used list positions
mat_r002<-matrix(mat[1048577:2097152],1024,1024)
mat_r003<-matrix(mat[2097153:3145728],1024,1024)
   
  write (mat_r0001, file = "mymat_r0001.txt")
  write (mat_r0001, file = "mymat_r0002.txt")
  ...
  write (mat_r0999, file = "mymat_r0999.txt")
  write (mat_r1000, file = "mymat_r1000.txt")
   
  rm(mat_r001)
  rm(mat_r002).. ... rm(mat_1000)
   
  Helllp, please.
   
  Miltinho :-)
  BRAZIL
   
   

                
---------------------------------

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to