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

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -