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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -