Learn R Programming

ribiosUtils (version 1.5-6)

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)

Arguments

x

A data.frame or matrix

m

Integer, number of rows to show

n

Integer, number of columns to show

Value

The first rows/columns of the input object

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

head, tail

Examples

Run this code
# NOT RUN {
myMat <- matrix(rnorm(10000), nrow=10L)
head(myMat)
headhead(myMat)
tailtail(myMat)

# }

Run the code above in your browser using DataLab