mod: Modulo Operation

modR Documentation

Modulo Operation

Description

Integer remainder of the division of the integer n by m: n mod m.

Usage

mod(n, m, ...)

## S4 method for signature 'matrix,numeric'
mod(n, m)

Arguments

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.

Value

An element of x, an Automorphism-class object.

Author(s)

Robersy Sanchez (https://genomaths.com).

Examples

## 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


genomaths/GenomAutomorphism documentation built on Dec. 12, 2024, 2:12 p.m.