Dear list-members,
I have a 9-by-9 matrix lets call it A with first row a11, a12, a13,...,
a19 etc.
I also have a vector of length 3 (B).
I want to construct a matrix of size 3x3 in the following way:
- divide matrix A to 9 3x3 blocks
- first is
a11, a12, a13
a21, a22, a23
a31, a32, a33
- I want to get rowSums of this A1 matrix
- Multiply A1*B and get a scalar, the first element of my new 3x3 matrix.
I could do that with loop. Can you suggest something that is more
elegant and faster?
Thank you
Daniel
______________________________________________
R-help@r-project.org 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.