[R] if statement problem

Rui Barradas ruipbarradas at sapo.pt
Sat Dec 24 00:42:53 CET 2011


reena wrote
> 
> Hello,
> 
> I want to do fisher test for the rows in data file which has value less
> than 5 otherwise chi square test .The p values from both test should be
> stored in one resulted file. but there is some problem with bold if
> statement. I don't know how 
> implement this line properly.
> 
> 
> x = cbind(obs1,obs2,exp1,exp2)
> a = matrix(c(0,0,0,0), ncol=2, byrow =TRUE)        #matrix with
> initialized values
> 
> for (i in 1: length(x[,1]))
> {
>       *if((x[i,1] || x[i,2] || x[i,3] || x[i,4]) < 5)*
>            
> 

Hello,
Try

*if(any(x[i,] <5))*

Merry Christmas
Rui Barradas



--
View this message in context: http://r.789695.n4.nabble.com/if-statement-problem-tp4230026p4230135.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list