add_matrices | R Documentation |
Add matrices together, specifying na.rm=TRUE or FALSE for each cell that has at least one finite value across corresponding cells in all matrices. Cells that have no finite values for any matrix will be set to empty_val (default NaN).
add_matrices(..., na.rm = TRUE, empty_val = NaN)
... |
Numeric matrices to add together (they must be the same size) |
na.rm |
Logical value, remove NA before calculating? |
empty_val |
Numeric value to use in cells that have no finite data across corresponding cells in all matrices |
The numeric matrix that is the sum of the input matrices (same shape)
A <- matrix(c(1:11, NA), nrow=4)
B <- matrix(c(1:4, NA, 6:11, NA), nrow=4)
C <- matrix(c(NA, NA, 3:11, NA), nrow=4)
add_matrices(A, B, C)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.