Is there a modulus operator in R? Anna
I havent found any. I am using this. mod<-function(x,m) { t1<-floor(x/m) return(x-t1*m) } Eryk *********** REPLY SEPARATOR *********** On 5/19/2003 at 8:56 AM Anna H. Pryor wrote:>Is there a modulus operator in R? > >Anna > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-helpDipl. bio-chem. Eryk Witold Wolski @ MPI-MG Dep. Vertebrate Genomics Ihnestrasse 73 14195 Berlin 'v' tel: 0049-30-84131285 / \ mail: wolski at molgen.mpg.de ---W-W----
On Mon, 19 May 2003, Anna H. Pryor wrote:> > Is there a modulus operator in R? >%% see ?"Arithmetic" -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand at nhh.no
help("%%") Anna H. Pryor wrote:> Is there a modulus operator in R? > > Anna > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
Hoi Wolski, --On maandag 19 mei 2003 18:07 +0200 Wolski <wolski at molgen.mpg.de> wrote:> I havent found any. > I am using this. > > mod<-function(x,m) > { > t1<-floor(x/m) > return(x-t1*m) > } >Isn't that just simply "%%" (or if i'm mistaken, perhaps '%/%')? regards, Paul -- Paul Lemmens NICI, University of Nijmegen ASCII Ribbon Campaign /"\ Montessorilaan 3 (B.01.03) Against HTML Mail \ / NL-6525 HR Nijmegen X The Netherlands / \ Phonenumber +31-24-3612648 Fax +31-24-3616066
Reasonably Related Threads
- Numbers that look equal, should be equal, but if() doesn't see as equal (repost with code included)
- Reading multiple files into R
- is.na(v)<-b (was: Re: Beginner's query - segmentation fault)
- is.na(v)<-b (was: Re: Beginner's query - segmentation fault)
- Subseting in a 3D array