In R what is the equivalent of "mod" function handle in Matlab?

r

Solution

There is a `%%` operator

> 5 %% 1
[1] 0    
> 5 %% 2
[1] 1
> 5 %% 3
[1] 2
> 5 %% 4
[1] 1                                             
> 5 %% 5
[1] 0
> 5 %% 6
[1] 5                  

You can use `?'%%'` to get its detailed description

Problem

How i can Find mod of two numbers in r? I know in MATLAB we can use "mod" but I am not sure about r. I searched the help and couldn't find mod function in r.

Original source