如何在r中找到两个数字的模?我知道在MATLAB中我们可以使用"mod",但我不确定r。我搜索了帮助,在r中找不到mod函数。
有一个%%
运算符
> 5 %% 1
[1] 0
> 5 %% 2
[1] 1
> 5 %% 3
[1] 2
> 5 %% 4
[1] 1
> 5 %% 5
[1] 0
> 5 %% 6
[1] 5
您可以使用?'%%'
来获取其详细描述