Description Usage Arguments Value See Also Examples
This function recurses over the first/last elements of a list to return a compact view of the list.
1 2 3 4 5 |
x |
A list of R objects. |
n |
A single integer. If positive, 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. |
m |
As |
... |
Arguments passed to |
Returns a list of length m
of the first/last element of
x
where the first n
elements of each entry is shown.
1 2 3 4 5 6 7 8 9 | x <- list(A = letters[1:9], B = matrix(runif(30), ncol = 3),
C = as.list(LETTERS[1:10]), D = function(x) { x^2 + 2*x + 1},
D = combn(1:5, m = 4), E = "A simple string.",
F = data.frame("unif" = runif(10), "norm" = rnorm(10)))
str(x)
head(x, n = 3L)
head(x, n = 2L, m = 7L)
tail(x, n = 3L)
tail(x, n = 3L, m = 3L)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.