externalVector {externalVector}R Documentation

Creating external vectors

Description

These functions can be used to create new external vector objects with newly allocated storage.

Usage

externalVector(type = "logical", length = 0, storageClass = "simpleStorage", indirect = FALSE)
externalLogical(length = 0, storageClass = "simpleStorage", indirect = FALSE)
externalInteger(length = 0, storageClass = "simpleStorage", indirect = FALSE)
externalNumeric(length = 0, storageClass = "simpleStorage", indirect = FALSE)
externalComplex(length = 0, storageClass = "simpleStorage", indirect = FALSE)
externalCharacter(length = 0, storageClass = "simpleStorage", indirect = FALSE)

Arguments

type A character-string, the name of the class of basic R vectors to be represented by the new external vector object.
length Length of the new external vector
storageClass name of the subclass of "externalStorage" to be used for storing the external vector elements.
indirect If TRUE, return an "indirectExternalVector" object.

Details

These functions are similar to the vector, logical, integer, numeric, complex and character functions in the R base package. These functions have an extra argument storageClass to specify the external storage class to use. The default is to use "simpleStorage" which uses garbage collected memory from R for storage.

Value

If indirect is FALSE (the default) the a new external vector object of the given length, given type with elements stored in an external storage object with class storageClass. Otherwise create the new external vector object but return it by wrapping it in an "indirectExternalVector" object.

See Also

vector, logical, integer, numeric, complex, character, list

Examples

x <- externalVector("numeric", 4)
x[] <- 1:4
x[1:3]
y <- x+2
y
x+y

[Package externalVector version 1.0.14 Index]