Convert a matrix to a 1 dimensional array

后端 未结 10 1497
忘了有多久
忘了有多久 2020-11-27 14:45

I have a matrix (32X48).

How can I convert the matrix into a single dimensional array?

10条回答
  •  攒了一身酷
    2020-11-27 15:28

    If you instead had a data.frame (df) that had multiple columns and you want to vectorize you can do

    as.matrix(df, ncol=1)

提交回复
热议问题