Question: Write a function called my_ifelse() that implements a vector form of the if-else statement without the ifelse() function. That is, the ith element of my_ifelse(test,
Write a function called my_ifelse() that implements a vector form of the if-else statement without the ifelse() function. That is, the ith element of my_ifelse(test, yes, no) will be yes[i] if test[i] is TRUE and no[i] if test[i] is FALSE. Values of yes or no should be recycled if either is shorter than test.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
