Convert a matrix to a list of vectors in R -


what elegant way of converting matrix list, each element of list vector containing elements in row of matrix?

a couple of approaches

assuming matrix called foo

lapply(seq_len(nrow(foo)), function(x) foo[x,])

or less efficiently.

lapply(apply(foo,1,list), unlist)


Comments

Popular posts from this blog

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

ruby on rails - Authlogic - how to make a registration and don't log in the new account? -