On Aug 28, 2010, at 11:32 AM, Cuckovic Paik wrote:


Thank you very much, David;
for row swapping: R2<==>R3

A=diag(1:4)
A
    [,1] [,2] [,3] [,4]
[1,]    1    0    0    0
[2,]    0    2    0    0
[3,]    0    0    3    0
[4,]    0    0    0    4
A1=A[c(1,3,2,4),]
A1
    [,1] [,2] [,3] [,4]
[1,]    1    0    0    0
[2,]    0    0    3    0
[3,]    0    2    0    0
[4,]    0    0    0    4

Yes, obviously. My point was illustration of construction of equivalent matrix operators (which was what I assumed was the educational goal motivating your insistence on a one step process for a translation operation, but maybe your goal was merely compact code.) The manipulation of indices does not generalize to rotations very well, either.

--
David.

______________________________________________
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.

Reply via email to