mod | R Documentation |
Integer remainder of the division of the integer n by m: n mod m.
mod(n, m, ...)
## S4 method for signature 'matrix,numeric'
mod(n, m)
n |
A numeric vector (preferably of integers), a matrix where each element can be reduced to integers. |
m |
An integer vector (positive, zero, or negative). |
... |
Not in use. |
An element of x, an Automorphism-class
object.
Robersy Sanchez (https://genomaths.com).
## Example 1
## Build a matrix 'n' and set a vector of integers 'm'
n <- diag(x=1, nrow = 4, ncol = 4) * c(43,125,2,112)
m <- c(64,4,4,64)
## Operation n mod m
mod(n = n, m = m)
## Or simply:
n %% m
## Example 2
m <- matrix(c(8,2,3, 11,12,13), nrow = 2)
m
m %% 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.