The help documentation suggests to use the command “stack”. Either it does not work or i did not understand well how to manage it. I need to vectorize the columns of a matrix in a certain order, any suggestion (or explanation on the command “stack”)? Thanks in advance. L ********************************************************************* credo nella ragione umana, e nella libertà e nella giustizia che dalla ragione scatiruscono. (sciascia) ********************************************************************* [[alternative HTML version deleted]]
Hi Lorenzo, maybe the following example is of use? a <- matrix(1:25,5,5) stack(as.data.frame(a[, c(1,3,5,2,4)])) Note that 'stack' takes a data frame or list as first argument (not a matrix). Therefore the matrix is first converted to a data frame using 'as.data.frame'. Christian