| head_tail | R Documentation |
Returns the first and last "parts" (rows or members) of a spectrum,
dataframe, vector, function, table or ftable. In other words, the combined
output from methods head and tail.
head_tail(x, n, ...)
## Default S3 method:
head_tail(x, n = 3L, ...)
## S3 method for class 'data.frame'
head_tail(x, n = 3L, ...)
## S3 method for class 'matrix'
head_tail(x, n = 3L, ...)
## S3 method for class ''function''
head_tail(x, n = 6L, ...)
## S3 method for class 'table'
head_tail(x, n = 6L, ...)
## S3 method for class 'ftable'
head_tail(x, n = 6L, ...)
x |
an R object. |
n |
integer. If positive, |
... |
arguments to be passed to or from other methods. |
The value returned by head_tail() is equivalent to row
binding the the values returned by head() and tail(),
although not implemented in this way. The same specializations as defined
in package 'utils' for head() and tail() have been
implemented.
An object (usually) like x but smaller, except when
n = 0. For ftable objects x, a transformed
format(x).
head_tail(default):
head_tail(data.frame):
head_tail(matrix):
head_tail(`function`):
head_tail(table):
head_tail(ftable):
For some types of input, like functions, the output may be confusing,
however, we have opted for consistency with existing functions. The code is
in part a revision of that of head() and tail() from package
‘utils’. This method is especially useful when checking spectral
data, as both ends are of interest.
head_tail() methods for function, table and ftable classes, are
wrappers for head() method.
head, and compare the examples and the values
returned to the examples below.
head_tail(1:20)
head_tail(1:20, 12)
head_tail(1:20, -7)
head_tail(1:20, -10)
head_tail(letters)
head_tail(sun.spct)
head_tail(sun.spct, 6)
head_tail(sun.data)
head_tail(as.matrix(sun.data))
head_tail(sun_evening.spct)
head_tail(sun_evening.mspct, 1L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.