externalMatrix {externalVector}R Documentation

Create an external matrix object

Description

This function can be used to create a new external matrix object.

Usage

externalMatrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames =
NULL, storageClass = (if (is(data, "externalVectorWithStorage"))
class(data@storage) else "simpleStorage"), indirect = FALSE)

Arguments

data An optional data vector.
nrow The desired number of rows.
ncol The desired number of columns.
byrow Not used.
dimnames A dimnames value for the external matrix: a list of length 2.
storageClass name of the subclass of "externalStorage" to be used for storing the external vector elements.
indirect If TRUE, return an "indirectExternalVector" object.

Details

This function is similar to the matrix function in R base package.

Value

If indirect is FALSE (the default) a new external matrix object with correct dimension and dimnames. Otherwise create a new external vector object but return it by wrapping it in an "indirectExternalMatrix" object with the correct dimension and dimnames.

See Also

matrix

Examples

x <- externalMatrix(1:6, nrow=2, ncol=3)
dim(x)
x[1, 1:2] # drop = FALSE by default
log(x)

[Package externalVector version 1.0.14 Index]