Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R function match() #56

Open
jmaccherone opened this issue May 15, 2013 · 0 comments
Open

R function match() #56

jmaccherone opened this issue May 15, 2013 · 0 comments

Comments

@jmaccherone
Copy link
Collaborator

Takes 2 vectors and returns a new vector with matching elements or N/A.

vector1 <- c(1, 2, 3, 4, 5)
vector2 <- c(1, 2, 3, 4, 0)
match(vector1, vector2)
[1] 1 2 3 4 NA
vector3 <- c(1, 2, 3)
vector4 <- c(2)
match(vector3, vector4)
[1] NA 1 NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant