match() function not working for two vectors in r

Viewed 247

I'm trying to use the match function in function with a for loop and it isn't working. Here is an example of the exact error I'm getting.

a <- c(1:10)
b <- c(2:11)
match(a,b)

It doesn't work. Here is the error I'm getting:

Error in match(a, b) : unused argument (b)

Then I tried something simpler:

match(2,a)

And it gives me this:

Error in match(2, a) : unused argument (a)

I really need this function for my code, can anyone tell me what I've done wrong?

0 Answers
Related