virtual_mat-class {matter} | R Documentation |
The virtual_mat
class implements virtual matrices, which may hold any matrix objects. It is provided primarily to allow combining of matter
matrix classes that could not be combined otherwise.
## Instance creation virtual_mat(data, datamode = "double", rowMaj = FALSE, dimnames = NULL, index = NULL, ...) # Check if an object is a virtual matrix is.virtual(x) # Coerce an object to a virtual matrix as.virtual(x, ...) ## Additional methods documented below
data |
A list of matrices to combine. |
datamode |
A 'character' vector giving the storage mode of the data on disk. Allowable values are R numeric and logical types ('logical', 'integer', 'numeric') and their C equivalents. |
rowMaj |
Whether the matrices in |
dimnames |
The names of the virtual matrix dimensions. |
index |
A length-2 list of row and column indices giving a submatrix, if desired. |
x |
An object to check if it is a virtual matrix or coerce to a virtual matrix. |
... |
Additional arguments to be passed to constructor. |
An object of class virtual_mat
.
data
:This slot stores the information about locations of the data on disk and within the files.
datamode
:The storage mode of the accessed data when read into R. This should a 'character' vector of length one with value 'integer' or 'numeric'.
paths
:A 'character' vector of the paths to the files where the data are stored.
filemode
:The read/write mode of the files where the data are stored. This should be 'rb' for read-only access, or 'rb+' for read/write access.
chunksize
:The maximum number of elements which should be loaded into memory at once. Used by methods implementing summary statistics and linear algebra. Ignored when explicitly subsetting the dataset.
length
:The length of the data.
dim
:Either 'NULL' for vectors, or an integer vector of length one of more giving the maximal indices in each dimension for matrices and arrays.
names
:The names of the data elements for vectors.
dimnames
:Either 'NULL' or the names for the dimensions. If not 'NULL', then this should be a list of character vectors of the length given by 'dim' for each dimension. This is always 'NULL' for vectors.
ops
:Delayed operations to be applied on atoms.
A length-2 list of row and column indices giving a virtual submatrix.
TRUE
if the virtual matrix should be transposed, and FALSE
otherwise.
virtual_mat
instances can be created through virtual_mat()
.
Standard generic methods:
x[i, j, ..., drop]
:Get or set the elements of the virtual matrix. Use drop = NULL
to return a subset of the same class as the object.
cbind(x, ...), rbind(x, ...)
:Combine virtual matrices by row or column.
t(x)
:Transpose a matrix. This is a quick operation which only changes metadata and does not touch the data representation.
Kylie A. Bemis
x <- matrix(runif(50), nrow=10, ncol=5) x <- virtual_mat(list(x, x)) x[]