Skip to content
Prev 169979 / 398506 Next

ifelse()

Take it in a couple of steps.  'ifelse' will take the evaluation of a
logical vector (first parameter) and return it second parameter if
TRUE or the third parameter if FALSE:
[1]  TRUE  TRUE  TRUE  TRUE FALSE FALSE
[1] 1 1 1 1 0 0
Now the second and third parameters can also be vectors and the
corresponding value will be chosen:
[1]  1  2  3  4 15 16
HTH
On Tue, Feb 10, 2009 at 4:44 PM, kayj <kjaja27 at yahoo.com> wrote: