On Thu, 2010-07-01 at 08:40 -0700, Yemi Oyeyemi wrote:
> Hi, I run into problem when writing a syntax, I don't know syntax that will 
> return true or false if an integer is odd or even.
> Thanks
> 
> OYEYEMI, Gafar Matanmi
> 
> Department of Statistics
> 
> University of Ilorin

Hi Yemi!

Your problem is solve wiht "!" and "%%", Look this example

> x <- 1:11
> x
 [1]  1  2  3  4  5  6  7  8  9 10 11
> x%%2
 [1] 1 0 1 0 1 0 1 0 1 0 1
> !(x%%2)
 [1] FALSE  TRUE FALSE  TRUE FALSE  TRUE FALSE  TRUE FALSE  TRUE FALSE

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to