[R] data.frame question

joseph
Sun, 07 Mar 2010 20:06:16 -0000

hello

can you show me how to create a data.frame from two factors x and y. column 1
should be equal to x and column 2 is 1 if it is common to y and 0 if it is not.

x=factor(c("A","B","C","D","E","F","G"))
y=factor(c("B","C","G"))

the output should look like this:
A    0
B    1
C    1
D    0
E    0
F    0
G    1

Thanks
Joseph Dhahbi



	[[alternative HTML version deleted]]