Skip to content
Prev 262918 / 398502 Next

combining strings

Dear R People:

Suppose I have the following two character vectors:

 xf
 [1] "W" NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
[1] NA  "k" "h" NA  "g" "r" "j" NA  "v" "d" NA  "v" NA  "z" "r" "r" "i"
I want to end up with

"W" "k" "h" ...

What is the best way to achieve this, please?  I was thinking that if
there is an exclusive "or" that it might work.  I've tried all kinds
of ifs, and ifelse, to no avail.


Thanks,
Erin