mutate_matrix {matrixset} | R Documentation |
Create/modify/delete matrices from a matrixset
object
Description
Applies functions that takes matrices as input and return similar matrices.
The definition of similar is that the new matrix has the same dimension and
dimnames as .ms
.
If the returned matrix is assigned to a new matrix, this matrix is added to the
matrixset
object. If it is assigned to an already existing matrix, it
overwrites the matrix of the same name.
Setting a matrix value to NULL
will not delete the matrix, but will
create an empty slot (NULL
) for the matrix.
To delete a matrix, use the function remove_matrix()
. See examples below.
Note that matrices are created sequentially and can be used by other name-value pairs. There is an example that showcases this.
Usage
mutate_matrix(.ms, ...)
Arguments
.ms |
A |
... |
Name-value pairs, ala
|
Value
A matrixset
with updated matrices.
Examples
# Notice how FC can be used as soon as created
ms <- mutate_matrix(student_results,
FC = remedial/failure,
foo = NULL,
logFC = log2(FC),
FC = remove_matrix())
# this is NULL
matrix_elm(ms, "foo")
# running this would return an error, since FC was deleted
# matrix_elm(ms, "FC")