how to use princomp() or prcomp() functions in R with large datasets, without trasposing the data?

StackOverflow https://stackoverflow.com/questions/12625837

  •  04-07-2021
  •  | 
  •  

문제

I have just started knowing PCA and i wish to use it for a huge microarray dataset with more than 4,00,000 rows. I have my columns in the form of samples, and rows in the form of genes/locus. I did go through some tutorials on using PCA and came across princomp() and prcomp() and a few others.

Now, as i learn here that, in order to plot ¨samples¨ in the biplot, i would need to have them in the rows, and genes/locus in the columns, and hence i will have to transpose my data before using it for PCA.

However, since the rows are more than 4,00,000, i am not really able to transpose them into columns, because the columns are limited. So my question is that, is there any way to perform a PCA on my data, without transposing it, using these R functions ? If not, can anyone of you suggest me any other way or method to do so ?

도움이 되었습니까?

해결책

Why do you hate to transpose your data? It's easy!

If you read your data into R (for example as the matrix microarray.data) you can transpose them with just a command:

transposed.microarray.data<-t(microarray.data)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top