[R] Replace a list of values in data frame

2008-02-29 Thread Silvia Lipski
Dear R-users, I am sorry if I ask for something that has been asked before, however, I still could not solve my little problem by consulting the previous thread on this topic: I would like to replace several values in a data frame, such as in: colorful subject response 1 meblack 2

[R] duplicate rows in a matrix

2007-11-02 Thread Silvia Lipski
Hi! Is there a fast way to duplicate rows in a matrix? I would like to do the following: change a matrix A like: [,1] [,2] [1,] Kevin 1 [2,] Alf 2 into : [,1] [,2] [1,] Kevin 1 [2,] Kevin 1 [3,] Alf 2 [4,] Alf 2 i.e. double all rows. The only way I could think off was: rbind(A