head.tail: Print the first and last N rows of an object

View source: R/head.tail.R

head.tailR Documentation

Print the first and last N rows of an object

Description

Print the first and last N rows of a dataframe

Usage

head.tail(x, n = 6L)

Arguments

x

an object

n

a single integer. If positive or zero, size for the resulting object: number of elements for a vector (including lists), rows for a matrix or data frame or lines for a function. If negative, all but the n last/first number of elements of x.

Details

For matrices, 2-dim tables and data frames, returns the first and last n rows when n >= 0 or all but the last and first n rows when n < 0.

Value

An object (usually) like x but generally smaller.

Author(s)

Jason Grafmiller

See Also

head, tail

Examples

head.tail(mtcars)

jasongraf1/JGmisc documentation built on March 21, 2022, 7:42 a.m.