how to combine 60 matrices in R quickly

后端 未结 3 941
时光说笑
时光说笑 2021-01-15 05:31

I have 60 matrices in R named as mat1, mat2....mat60 and I would like to combine them into a big matrix using rbind. I know that I could write something like



        
3条回答
  •  执笔经年
    2021-01-15 06:23

    This should be faster:

     library(data.table)
     rbindlist(matList)
    

    EDIT The above solution will work for list of data.frame or list, If you have a list of matrix you should convert them before:

     rbindlist(lapply(ll,as.data.frame))
    

提交回复
热议问题