How to convert a huge list-of-vector to a matrix more efficiently?

后端 未结 5 990
别那么骄傲
别那么骄傲 2020-12-07 14:44

I have a list of length 130,000 where each element is a character vector of length 110. I would like to convert this list to a matrix with dimension 1,430,000*10. How can I

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 15:30

    It would help to have sample information about your output. Recursively using rbind on bigger and bigger things is not recommended. My first guess at something that would help you:

    z <- list(1:3,4:6,7:9)
    do.call(rbind,z)
    

    See a related question for more efficiency, if needed.

提交回复
热议问题