corner {BurStMisc}R Documentation

Portion of an Array or Data Frame

Description

Returns an array (or data frame) of the same number of dimensions as the input, but generally with smaller dimensions.

Usage

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

Arguments

x

an array (which includes matrices) or data frame.

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 generally should have length at least that of the dim of the array – it is replicated if not. 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.

See Also

head, tail.

Examples

  corner(freeny.x)
  corner(freeny.x, "br", c(2,3))

  # with three-dimensional arrays:
  corner(iris3)
  corner(array(1:1000, rep(10, 3)), "brf", 2:4)

[Package BurStMisc version 1.1 Index]