asEach {externalVector}R Documentation

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

x An external vector object.
type Character-string, a basic vector mode.
arrayOnly If arrayOnly is FALSE (the default) do not copy extra slots like Names, DimNames or Dim.

Value

Another external vector object of same length but with class(defaultElement(x)) == class(type).

See Also

as to convert an object to a different class.

Examples

x <- externalCharacter(4)
x[] <- c("1", "2", "3", "4")
asEach(x, "integer")

[Package externalVector version 1.0.14 Index]