\name{asEach}
\alias{asEach}
\alias{asEach,ANY,character-method}
\title{ Coerce each element of an external vector to a particular type }
\description{
  This generic coerces each element of an external vector to a
  particular type.
}
\usage{
asEach(x, type, arrayOnly = FALSE)
}
\arguments{
  \item{x}{ An external vector object. }
  \item{type}{ Character-string, a basic vector mode. }
  \item{arrayOnly}{ If arrayOnly is \code{FALSE} (the default) do not
    copy extra slots like \code{Names}, \code{DimNames} or \code{Dim}.
  }
}
\value{
  Another external vector object of same length but with
  \code{class(defaultElement(x)) == class(type)}.
}
\seealso{ \code{\link[methods]{as}} to convert an object to a different class. }
\examples{
x <- externalCharacter(4)
x[] <- c("1", "2", "3", "4")
asEach(x, "integer")
}
\keyword{classes}