Dear all, Sorry to bother you with such a stupid question, but I just cannot find the solution to my problem. I'd like to use matrix multiplication for meanA and factorial 3. I use the command meanA%*%factorial 3. But everything I get is: Error in factorial3 %*% A : non-conformable arguments I know that the number of the columns of the first vector has to be the same number of rows of the second vector to be able to use matrix multiplication, but that is the case here. I also tried it with two columns for factorial 3 and that didnt work either. Can someone help me out with this?' these are my matrices: meanA [,1] [,2] [1,] 3.666667 4.666667> factorial3[,1] [1,] 1 Thank you so much! Cheers, maria -- View this message in context: http://r.789695.n4.nabble.com/matrix-multiplication-tp3895833p3895833.html Sent from the R help mailing list archive at Nabble.com.
Your question as answered by Timothy in your previous thread http://r.789695.n4.nabble.com/Re-Creating-the-mean-using-algebra-matrix-td3895689.html flokke wrote:> > Dear all, > Sorry to bother you with such a stupid question, but I just cannot find > the solution to my problem. > > I'd like to use matrix multiplication for meanA and factorial 3. > I use the command meanA%*%factorial 3. > But everything I get is: Error in factorial3 %*% A : non-conformable > arguments > > I know that the number of the columns of the first vector has to be the > same number of rows of the > second vector to be able to use matrix multiplication, but that is the > case here. I also tried it with > two columns for factorial 3 and that didnt work either. > > Can someone help me out with this?' > > these are my matrices: > > meanA > [,1] [,2] > [1,] 3.666667 4.666667 > >> factorial3 > [,1] > [1,] 1 > > Thank you so much! > Cheers, maria >-- View this message in context: http://r.789695.n4.nabble.com/matrix-multiplication-tp3895833p3895860.html Sent from the R help mailing list archive at Nabble.com.
On 12/10/11 09:11, flokke wrote:> Dear all, > Sorry to bother you with such a stupid question, but I just cannot find the > solution to my problem. > > I'd like to use matrix multiplication for meanA and factorial 3. > I use the command meanA%*%factorial 3. > But everything I get is: Error in factorial3 %*% A : non-conformable > arguments > > I know that the number of the columns of the first vectorfirst ***MATRIX***> has to be the same > number of rows of the > second vectorsecond ***MATRIX***> to be able to use matrix multiplication, but that is the case > here.No it isn't!!! Your ``factorial3'' has ***one*** row, and ``meanA'' has ***two*** columns. So the arrays are not conformable, just like the error message says! There are three sorts of people; those who can count, and those who can't!> I also tried it with > two columns for factorial 3 and that didnt work either.Try it with two ***rows*** for factorial3!!! And watch those spaces in names. They don't belong.> Can someone help me out with this?' > > these are my matrices: > > meanA > [,1] [,2] > [1,] 3.666667 4.666667 > >> factorial3 > [,1] > [1,] 1To repeat: (1 x 2) times (1 x 1) doesn't work. Note that (n x 2) times (2 x m) *does* work, and gives an (n x m) result. cheers, Rolf Turner