Should I use a data.frame or a matrix?

前端 未结 6 1590
我在风中等你
我在风中等你 2020-11-28 00:59

When should one use a data.frame, and when is it better to use a matrix?

Both keep data in a rectangular format, so sometimes it\'s unclear

6条回答
  •  不知归路
    2020-11-28 01:33

    The matrix is actually a vector with additional methods. while data.frame is a list. The difference is down to vector vs list. for computation efficiency, stick with matrix. Using data.frame if you have to.

提交回复
热议问题