Learn R Programming

dvmisc (version 1.1.4)

headtail: Return the First and Last Part of an Object

Description

Simply head and tail combined.

Usage

headtail(x, ...)

Arguments

x

Input object.

...

Additional arguments to pass to head and tail functions.

Value

Same class as x.

Examples

Run this code
# NOT RUN {
# Generate data from N(0, 1), sort, and look at smallest and largest 3 values
x <- rnorm(1000)
x.sorted <- sort(x)
headtail(x.sorted, 3)

# }

Run the code above in your browser using DataLab