Re: [R] assign object with loop (translation from SAS to R)

2012-06-29 Thread lynx
Dear Rui Barradas David Winsemius ONKELINX, Thierry David Carlson I really appreciate your helps. I did not realize that there were such many ways to do it. Among them, I just pick up the simple one and it worked out. It was like this. <> n <- 10 p <- 9 dataset <- data.frame(matrix(rep(seq

[R] assign object with loop (translation from SAS to R)

2012-06-28 Thread lynx
I have a dataset named DM with p1, p2, , p9 (9 columns, numerical values) I would like to calculate to multify each pair of columns (p1p2, p1p3,... p1p9, p2p3, p2p4 p8p9) and assign them in p1p2, p1p3,... p1p9, p2p3, p2p4 p8p9 In SAS, l=0; p_int_sum=0; do i=1 to 8; do j=(i