I find it slightly surprising, that ifelse(TRUE, character(0), "") returns NA instead of character(0). [WNT 2.6.2 Patched] -- Heikki Kaskelma