Skip to content
Prev 319042 / 398506 Next

How to transpose it in a fast way?

On Mar 7, 2013, at 01:18 , Yao He wrote:

            
As others have pointed out, that's a lot of data! 

You seem to have the right idea: If you read the columns line by line there is nothing to transpose. A couple of points, though:

- The cbind() is a potential performance hit since it copies the list every time around. geno_t <- vector("list", 60000) and then 
geno_t[[i]] <- <etc>

- You might use scan() instead of readLines, strsplit

- Perhaps consider the data type as you seem to be reading strings with 16 possible values (I suspect that R already optimizes string storage to make this point moot, though.)