Portion of an Array

Description

Returns an array of the same number of dimensions as the input, but generally with smaller dimensions.

Usage

corner(x, corner = "tlffff", n = rep(6, length(corner)))

Arguments

x an array.
corner a single character string which codes the particular corner of the array that is desired. The first character is either "t" (top) or "b" (bottom). The second character is either "l" (left) or "r" (right). Remaining characters should be either "f" (front) or "b" (back).
n a vector of positive integers which should have length at least that of the dim of the array. This states (the maximum of) each of the dimensions of the result.

Value

an array similar to the input x, but with smaller dimensions in general.

Note

This presumes that head and tail are available if called on 1-dimensional arrays or non-array objects.

Author

Patrick Burns

See Also

head, tail.

Examples

data(freeny) # R command, not for S-PLUS
corner(freeny.x)
corner(freeny.x, "br", c(2,2))

# R example
data(iris3) 
corner(iris3)

# S-PLUS example
corner(iris)