] 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
> 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
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
>
3 matches
Mail list logo