[R] prcomp(): How do I multiply two matrices
tr206 at kent.ac.uk
Fri Oct 7 20:24:00 CEST 2016
I am trying to do a principal components analysis using the attached data. My code looks as follows. I want to calculate the time series of the principal components (PC) . To this end, I transform the coefficients and the data into matrices and employ a matrix multiplication but it does not work.
PC1<-coef1 %*% data
This is the error message I get.
Error in coef1 %*% data : non-conformable arguments
So, what is wrong with my code? How do I multiply the coefficients with the observations?
More information about the R-help