Skip to content
Prev 318631 / 398506 Next

if value is in vector, perform this function

I think the command you want is:

if(t %in% feed_days) C_A <- 1.5 else C_A <- 0

Do not confuse `%in%` (which is essentially
"are the left-hand values in the right-hand
vector)

with

"in" of the `for` loop.

By the way,

if(t == TRUE)

is redundant -- better is:

if(t)


Pat
On 02/03/2013 23:57, Louise Stevenson wrote: