RE: [R] Odd and Even

About this list Date view Thread view Subject view Author view Attachment view

From: Adaikalavan Ramasamy (gisar@nus.edu.sg)
Date: Mon 07 Apr 2003 - 12:31:03 EST


Message-id: <024D6AEFCB92CB47BA1085751D184BB801053FA1@MBXSRV03.stf.nus.edu.sg>

Or if you are very lazy there is is.odd() and is.even() in library sma.

-----Original Message-----
From: Uwe Ligges [mailto:ligges@statistik.uni-dortmund.de]
Sent: Sunday, April 06, 2003 8:36 PM
To: Dave Caccace
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Odd and Even

Dave Caccace wrote:
> Hi,
> I'm trying to create a function, jim(p) which varies
> depending on whether the value of p is odd or even. I
> was trying to use th eIf function, but i cant work out
> a formula to work out if p is odd or even.
> Thanks,
> Dave

if(p %% 2) "odd" else "even"

Uwe Ligges

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:41 EST