Re: [R] Difficulty with 'merge'

2006-01-05 Thread Christoph Buser
Dear Michael Please remark that merge calculates all possible combinations if you have repeated elements as you can see in the example below. ?merge ... If there is more than one match, all possible matches contribute one row each. ... Maybe you can apply aggregate in a reasonable way on your

[R] Difficulty with 'merge'

2006-01-04 Thread Michael Kubovy
Dear R-helpers, Happy New Year to all the helpful members of the list. Here is the behavior I'm looking for: v1 - c(a,b,c) n1 - c(0, 1, 2) v2 - c(c, a, b) n2 - c(0, 1 , 2) (f1 - data.frame(v1, n1)) v1 n1 1 a 0 2 b 1 3 c 2 (f2 - data.frame(v2, n2)) v2 n2 1 c 0 2 a 1 3