[R] Combine vectors under the names

Art U art.tem.us at gmail.com
Sun Apr 2 23:02:01 CEST 2017


Hello,

Lets say I have 2 vectors:
x1=c("a1"=0,"b3"=2,"e2"=-2);
x2=c("c"=3,"d"=4,"f"=5);
and vector of names in specific order:
N=c("a1","b3","d","e2","c","f")
and I want to combine them to vector C:

C=

a1 b3  d e2  c  f
 0  2  4 -2  3  5


Basically, just fill vector N with values from vector x1 and x2. How can I
do that?
Thank you in advance.
Art

-- 
*I like to pretend I'm alone*. *Completely alone*. *Maybe post-apocalypse
or plague*... *Whatever*. *No-one left to act normal for. No need to hide
who I really am. It would be... freeing*. *...*

	[[alternative HTML version deleted]]



More information about the R-help mailing list