Re: [R] If function error: missing value where TRUE/FALSE needed

2012-03-05 Thread charo san andres
(relativenes[i] < cost) {dispersal[i] <-((relativenes[i]- cost)/(relativenes[i]- cost*cost))} else {dispersal[i] <- 0}} } } > Subject: Re: [R] If function error: missing value where TRUE/FALSE needed > From: petr.pi...@prech

Re: [R] If function error: missing value where TRUE/FALSE needed

2012-03-04 Thread Petr PIKAL
which is treated by if as an inappropriate input so there is missing value error. But without data and its structure it is only a guess. Regards Petr > > [R] If function error: missing value where TRUE/FALSE needed > > > Hello! > I am trying to get a logic estatement in

[R] If function error: missing value where TRUE/FALSE needed

2012-03-04 Thread charo san andres
Hello! I am trying to get a logic estatement in R using the if function, but it is all the time comming and error, I have tryied different methods but nothing is working the sentence is the following: dispersal[1] <- if (any (relativenes[1] < cost)) ((relativenes[1]- cost)/(relativenes[1]- co