Use switch() instead of ifelse() to return a NULL

You may also like...