[R] math-operations

Alberto Murta amurta at ipimar.pt
Fri Mar 30 15:59:22 CEST 2007


On Friday 30 March 2007 14:46, Alberto Murta wrote:
> On Friday 30 March 2007 14:34, Schmitt, Corinna wrote:
> > 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
>
> trunc(513 / 5)

Sorry! it's   trunc(513 / 100)

>
> > 513 mod 100 = 13
>
> 513 %% 100
>
> > 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.

-- 
   Alberto G. Murta
IPIMAR - Portuguese Institute of Fisheries and Marine Research
Avenida de Brasilia s/n; 1449-006 Lisboa; Portugal
Tel: +351 213027120; Fax: +351 213015948; email: amurta at ipimar.pt



More information about the R-help mailing list