tatami-utils | R Documentation |
Utility functions that directly operate on the pointers produced by initializeCpp
.
Some of these are used internally by initializeCpp
methods operating on DelayedArray classes.
tatami.bind(xs, by.row)
tatami.transpose(x)
tatami.subset(x, subset, by.row)
tatami.arith(x, op, val, by.row, right)
tatami.compare(x, op, val, by.row, right)
tatami.logic(x, op, val, by.row)
tatami.round(x)
tatami.log(x, base)
tatami.math(x, op)
tatami.not(x)
tatami.binary(x, y, op)
tatami.dim(x)
tatami.row(x, i)
tatami.column(x, i)
tatami.row.sums(x, num.threads)
tatami.column.sums(x, num.threads)
tatami.row.nan.counts(x, num.threads)
tatami.column.nan.counts(x, num.threads)
tatami.is.sparse(x)
tatami.prefer.rows(x)
tatami.realize(x, num.threads)
tatami.multiply(x, val, right, num.threads)
xs |
A list of pointers produced by |
by.row |
Logical scalar indicating whether to apply the operation on the rows.
|
x |
A pointer produced by |
subset |
Integer vector containing the subset of interest.
These should be 1-based row or column indices depending on |
op |
String specifying the operation to perform.
|
val |
For
For
|
right |
For For |
base |
Numeric scalar specifying the base of the log-transformation. |
y |
A pointer produced by |
i |
Integer scalar containing the 1-based index of the row (for |
num.threads |
Integer scalar specifying the number of threads to use. |
For tatami.dim
, an integer vector containing the dimensions of the matrix.
For tatami.is.sparse
, a logical scalar indicating whether the matrix is sparse.
For tatami.prefer.rows
, a logical scalar indicating whether the matrix prefers iteration by row.
For tatami.row
or tatami.column
, a numeric vector containing the contents of row or column i
, respectively.
For tatami.row.sums
or tatami.column.sums
, a numeric vector containing the row or column sums, respectively.
For tatami.row.nan.counts
or tatami.column.nan.counts
, a numeric vector containing the number of NaNs in each row or column, respectively.
For tatami.realize
, a numeric matrix or dgCMatrix with the matrix contents.
The exact class depends on whether x
refers to a sparse matrix.
For tatami.multiply
, a numeric matrix containing the matrix product of x
and other
.
For all other functions, a new pointer to a matrix with the requested operations applied to x
or xs
.
Aaron Lun
x <- Matrix::rsparsematrix(1000, 100, 0.1)
ptr <- initializeCpp(x)
tatami.dim(ptr)
tatami.row(ptr, 1)
rounded <- tatami.round(ptr)
tatami.row(rounded, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.