[R] Bind together two vectors of different length...

Andris Jankevics andza at osi.lv
Mon Jul 30 12:09:59 CEST 2007


Dear everyone,

I've got difficulties in realizing the following
task:

I have two vectors:
A <- c(1:10)
B<- seq(1,10,2)

Now I want to make a table form vectors A and B as rows, and if a value of A 
isn't present B, then I want to put a N/A symbol in it:

Output should look like this:

1 2 3 4 5 6 7 8 9 10 
1 0 3 0 5 0 7 0 9 0

How can I do this in R?

Thank you.

-- 
Andris Jankevics
Assistant
Department of Medicinal Chemistry
Latvian Institute of Organic Synthesis
Aizkraukles 21, LV-1006, Riga, Latvia



More information about the R-help mailing list