Learn R Programming

ribiosUtils (version 1.7.7)

headhead: head/tail function for matrix or data.frame

Description

These two functions reassembles head and tail, showing the first rows and columns of 2D data structures, e.g. matrix or data.frame.

Usage

headhead(x, m = 6L, n = 6L)

Value

The first rows/columns of the input object

Arguments

x

A data.frame or matrix

m

Integer, number of rows to show

n

Integer, number of columns to show

Author

Jitao David Zhang <jitao_david.zhang@roche.com>

Details

While head and tail can be applied to data.frame or matrix as well, they show all columns of the first (last) rows even if the matrix has a large number of columns. These two function, headhead and tailtail, circumvent this problem by showing only the first rows AND the first columns.

See Also

Examples

Run this code

myMat <- matrix(rnorm(10000), nrow=10L)
head(myMat)
headhead(myMat)
tailtail(myMat)

Run the code above in your browser using DataLab