head(x, n=6, ...) tail(x, n=6, ...)
x
if
x
is not a function. If
x
is a function, the returned value is a vector of strings that have line numbers
at the beginning of each string. If
x
is an unnamed vector,
then
tail(x)
attaches names of the form
[index]
to indicate where the entries came from.
These functions return either the first or last
n
elements of a vector, rows of a data frame or matrix, or lines of a function.
If
x
is a matrix without row names, then
tail
will add row names in the form "[n,]" to
the return value.
Functions
head
and
tail
emulate R functions, but in S-PLUS, the argument
addrownums
is ignored in the
tail
function. Also, in S-PLUS (but not R) row
names are added to vector values returned by tail.
head(objects) head(CO2, n=nrow(CO2)/10) head(state.x77, n=20) tail(fuel.frame) tail(bonds.yield)