\name{abind}

\alias{abind}

\title{Bind arrays along given extent}

\description{
General version of \code{rbind} and \code{cbind} to combine two
arrays along a given extent.  If no extent is specified, then
binding is along the final extent.  Names are preserved and
combined where possible.}

\usage{
abind(x, y, ..., ALONG=length(dx))
}

\arguments{
 \item{x, y}{Arrays to be bound}
 \item{\dots}{Further arrays to be bound in sequence}
 \item{ALONG}{Extent along which arrays are to be bound}
}

\value{An array which is the concantenation of the supplied
arrays along the extent supplied as \code{ALONG}.}

\author{Jonathan Rougier, \email{J.C.Rougier@durham.ac.uk}}

\note{Uses \code{cbind} as the primitive concatenation operator,
as this handles the names of the bound extent gracefully.}

\seealso{\code{\link{rbind}}, \code{\link{cbind}}}

\examples{
x <- array(1:24, c(2, 3, 4), list(c("heads", "tails"),
  LETTERS[1:3], NULL))
y <- array(1:48, c(2, 4, 4), list(c("swallows", "amazons"),
  LETTERS[4:7], NULL))
abind(x, y, ALONG=2)
dimnames(x) <- NULL
abind(x, y, ALONG=2)		# graceful handling of names
}

\keyword{array}

