Re: [R] Is variable in one vector part of variable in another

2008-06-02 Thread Bert Gunter
] Is variable in one vector part of variable in another > I have 2 vectors x & z > x has 10 variables in it > z has 75 variable in it > > I need to check all 75 variables in z and see if they are present in the > vector x. In addition to the solution using %in% which has

Re: [R] Is variable in one vector part of variable in another

2008-05-31 Thread Philipp Pagel
> I have 2 vectors x & z > x has 10 variables in it > z has 75 variable in it > > I need to check all 75 variables in z and see if they are present in the > vector x. In addition to the solution using %in% which has already been suggested, you may also want to play with something like this: # m

Re: [R] Is variable in one vector part of variable in another

2008-05-31 Thread Dr. S. B. Nguah
darthgervais wrote: > > I have 2 vectors x & z > x has 10 variables in it > z has 75 variable in it > > I need to check all 75 variables in z and see if they are present in the > vector x. > So far this is what I have: > > for (i in 0:75){ > if (z[i]==x) (w=w+1) > } > > Thanks in advance >