function similar to head() for matrix

巧了我就是萌 提交于 2019-12-02 02:21:30

There is a function called peek in a package called futile.matrix.

library(futile.matrix)
m <- matrix(c(1,3,4,2, 5,10,11,2, 3,42,8,22, 23,15,3,8), ncol = 4)
peek(m, 4)

From the description of that function:

"Peek is a simple utility to conveniently look at a portion of a matrix. This is similar to head and tail but provides a 2-dimensional slice instead of a complete row."

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!