I'm trying to create a list from a big matrix as following:
A = matrix(rnorm(500000*10), nrow = 500000, ncol = 10)
B = list()
begin = Sys.time()
for (i in 1: nrow(A)){
B[[i]] = A[i,]
}
end = Sys.time()
end - begin
However it takes too much time. Any idea to optimize this code? Thank you.