Re: [R] ODD and EVEN numbers

2010-04-01 Thread Detlef Steuer
Just to give you a hint for the future: If you ask google for "odd, even, R" you get a messages from 2003 as second match: --- 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 > w

[R] ODD and EVEN numbers

2010-04-01 Thread girlme80
Excuse me Carl Withoft! For your information, this is not my homework. I'm just helping my friend in "a part" of her R code. And everytime I ask a question here, it's just a "SMALL PART" of the 2-pages-program that I am doing. And for your information, the answers that I get, I still think on

Re: [R] ODD and EVEN numbers

2010-04-01 Thread Carl Witthoft
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 __

Re: [R] ODD and EVEN numbers

2010-03-31 Thread tj
Thank you guys for responding to my question. Have a great day!:-) -- View this message in context: http://n4.nabble.com/ODD-and-EVEN-numbers-tp1747032p1747411.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mail

Re: [R] ODD and EVEN numbers

2010-03-31 Thread Stephan Kolassa
(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 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] ODD and EVEN numbers

2010-03-31 Thread David Winsemius
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 ___

Re: [R] ODD and EVEN numbers

2010-03-31 Thread Erik Iverson
See %% under ?Arithmetic tj wrote: Hi, anyone here who knows how to determine if an integer is "odd" or "even" in R? Thanks. tj __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] ODD and EVEN numbers

2010-03-31 Thread tj
Hi, anyone here who knows how to determine if an integer is "odd" or "even" in R? Thanks. tj -- View this message in context: http://n4.nabble.com/ODD-and-EVEN-numbers-tp1747032p1747032.html Sent from the R help mailing list archive at Nabble.com.