[R] R: math-operations

Guazzetti Stefano Stefano.Guazzetti at ausl.re.it
Fri Mar 30 15:41:13 CEST 2007


I guess you need "%%" and ""%/%"

try  
> 513 %/% 100
[1] 5
> 513 %% 100
[1] 13

?"%%"


Stefano


-----Messaggio originale-----
Da: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]Per conto di Schmitt, Corinna
Inviato: venerdì 30 marzo 2007 15.34
A: r-help at stat.math.ethz.ch
Oggetto: [R] math-operations


Hallo R-experts,

for a function I need to work with the commands "div" and "mod" known
from Pascal and Ruby. The only help I know is "ceiling()" and "floor()"
in R. Do "div" and "mod" exist? When yes please send me a little
example.

In Pascal-Syntax I want: 
513 div 100 = 5
513 mod 100 = 13

How can I get this in R-syntax?

Thanks, Corinna

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list