[R] Matrix transposition

2012-04-30 Thread Filoche
Hi everyone. I want to transpose a data frame. Lets say the following DF: df = data.frame(matrix(ncol=4, nrow = 10)) df[,1] = c(rep(1,5),rep(2,5)) df[,2] = c(rep('a',4),rep('b',3),rep('c',3)) df[,3] = c(letters[5:14]) df[,4] = runif(10) I would like to form a data frame with each line

Re: [R] Matrix transposition

2012-04-30 Thread Rui Barradas
Hello, Filoche wrote Hi everyone. I want to transpose a data frame. Lets say the following DF: df = data.frame(matrix(ncol=4, nrow = 10)) df[,1] = c(rep(1,5),rep(2,4), 3) df[,2] = c(rep('a',4),rep('b',3),rep('c',3)) df[,3] = c(letters[c(5:13,13)]) df[,4] = runif(10) I would

Re: [R] Matrix transposition

2012-04-30 Thread Filoche
Thank you sire, this is exactly what I was looking for. Many thanks, Phil -- View this message in context: http://r.789695.n4.nabble.com/Matrix-transposition-tp4599219p4599310.html Sent from the R help mailing list archive at Nabble.com. __