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
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
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
__
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
(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
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
___
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
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.
8 matches
Mail list logo