# ODD and EVEN numbers

8 messages
Open this post in threaded view
|
Report Content as Inappropriate

## ODD and EVEN numbers

 This post was updated on . CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: ODD and EVEN numbers

 See %% under ?Arithmetic tj wrote: > Hi, > > anyone here who knows how to determine if an integer is "odd" or "even" in > R? > Thanks. > > > tj ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: ODD and EVEN numbers

 In reply to this post by TJ-2 On Mar 31, 2010, at 12:43 PM, tj wrote: > > Hi, > > anyone here who knows how to determine if an integer is "odd" or   > "even" in > R? > Thanks.  > 2 %% 2 == 0 [1] TRUE  > 3 %% 2 == 0 [1] FALSE is.even <- function(x){ x %% 2 == 0 }  > is.even(2) [1] TRUE -- David Winsemius, MD West Hartford, CT ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: ODD and EVEN numbers

 In reply to this post by TJ-2 (foo %% 2) == 0 See ?"%%" HTH Stephan tj schrieb: > Hi, > > anyone here who knows how to determine if an integer is "odd" or "even" in > R? > Thanks. > > > tj ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: ODD and EVEN numbers

 This post was updated on . In reply to this post by TJ-2 CONTENTS DELETED The author has deleted this message.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: ODD and EVEN numbers

 In reply to this post by TJ-2 There you go,  solving his homework again...  >  > Hi,  >  > anyone here who knows how to determine if an integer is "odd" or  > "even" in  > R?  > Thanks.   > 2 %% 2 == 0 [1] TRUE   > 3 %% 2 == 0 [1] FALSE is.even <- function(x){ x %% 2 == 0 }   > is.even(2) [1] TRUE ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: ODD and EVEN numbers

 CONTENTS DELETED The author has deleted this message.