head(x, ...) ## Default S3 method: head(x, n = 6L, ...) ## S3 method for class 'array': head(x, n = 6L, ...) ## S3 method for class 'data.frame': head(x, n = 6L, ...) ## S3 method for class 'matrix': head(x, n = 6L, ...) ## S3 method for class 'function': head(x, n = 6L, ...) tail(x, ...) ## Default S3 method: head(x, n = 6L, ...) ## S3 method for class 'array': head(x, n = 6L, keepnums = TRUE, addrownums, ...) ## S3 method for class 'data.frame': head(x, n = 6L, keepnums = TRUE, addrownums, ...) ## S3 method for class 'matrix': head(x, n = 6L, keepnums = TRUE, addrownums, ...) ## S3 method for class 'table': head(x, n = 6L, keepnums = TRUE, addrownums, ...) ## S3 method for class 'function': head(x, n = 6L, keepnums = TRUE, addrownums, ...)
x | an object. |
n |
If x is a vector or a function, a non-negative integer
indicating how many elements of the vector or lines of the function to return
or a negative integer indicating how many not to return.
If x is an array, a table, or a data.frame or any object for which dim(x) is not NULL, then n may be a vector of integers specifying how many slices of each dimension to return (NA means all slices in that dimension). If the length of n is less than length(dim(x)) then n will be padded with NA to the length(dim(x)). |
keepnums | A logical value used by the methods for objects with dimensions. If TRUE, tail will attach dimnames entries for the shortened dimensions to indicate where the rows, columns, etc. came from in x. If a dimension has a dimnames entry, keepnums will not alter it. |
addrownames | A defunct name for the keepnums argument. If you use it, you will be warned to use keepnums instead. |
... | additional arguments passed to the head or tail method. |
head(objects()) head(matrix(1:16,4), n=2) head(data.frame(x=1:10,y=101:110), n=-3) tail(matrix(1:16,4,4), n=2) tail(matrix(1:16,4), n=c(-2,3)) tail(matrix(1:16,4), n=c(NA,3)) tail(data.frame(x=1:10,y=101:110), n=-3)