Skip to content
Back to formatted view

Raw Message

Message-ID: <BANLkTik6KiWTgW-8Tdv2H2oZco_QVPxUaQ@mail.gmail.com>
Date: 2011-06-17T01:59:03Z
From: Erin Hodgess
Subject: 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
> xg
 [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


-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess at gmail.com