>>>>> "Christian" == Christian Ritz <[EMAIL PROTECTED]>
>>>>>     on Mon, 22 May 2006 11:17:32 +0200 writes:

    Christian> Hi Lorenzo,
    Christian> maybe the following example is of use?


    Christian> a <- matrix(1:25,5,5)

    Christian> stack(as.data.frame(a[, c(1,3,5,2,4)])) 


    Christian> Note that 'stack' takes a data frame or list as first argument 
(not a
    Christian> matrix). Therefore the matrix is first converted to a data frame 
using
    Christian> 'as.data.frame'.

I do wonder though if not simply

 > c(a[, c(1,3,5,2,4)])
 [1]  1  2  3  4  5 11 12 13 14 15 21 22 23 24 25  6  7  8  9 10 16 17 18 19 20

is enough for Lorenzo, in this case ??

Martin

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to