I cannot figure out what I need. Here is simplification what I actually need.
I would like to process each function if certain number appears in a vector,here is example:
v <- c(111,88,222,99,555,1,9,6)if(111 %in% v){ x <- 111+0.1 } else if(222 %in% v){ y <- 222+0.1 } else if(555 %in% v){ z <- 555+0.1 }
I would like to process each function if given number is found in vector v
.
In the above example the if else
example would give out number 111.1
,222.1
,333.1
, what I'm doing wrong here?
Basicaly, I would like to calculate each function if certain number appears in vector.