convert list to a matrix or array?

后端 未结 1 564
臣服心动
臣服心动 2021-01-11 09:35
  > str(mylist)
         List of 50
      $ : logi [1:14] 0.2 0.3 0.2 ...
      $ : logi [1:14] 0.1 0.3 0.6 ...
      $ : logi [1:14] 0.2 0.9 0.1 ...
相关标签:
1条回答
  • 2021-01-11 09:47

    This will produce the desired array (with NAs for the nonnumeric values):

    array(as.numeric(unlist(mylist)), dim=c(14, 5, 10))
    
    0 讨论(0)
提交回复
热议问题