Displaying 1 result from an estimated 1 matches for "tp20680567p20680900".
2008 Nov 25
2
Reshape matrix from wide to long format
I forgot the reshape equivalent for converting from wide to long format. Can someone help as my matrix is very big. The followin is just an example.
> m <- matrix(1:20, nrow=4, dimnames=list(LETTERS[1:4], letters[1:5]))
> m
a b c d e
A 1 5 9 13 17
B 2 6 10 14 18
C 3 7 11 15 19
D 4 8 12 16 20
> as.data.frame(cbind(rep(rownames(m), ncol(m)), rep(colnames(m), each=nrow(m)),