I have a data frame with two columns: an ID and some numeric value foo. I want to be able to get a vector of the IDs corresponding to foo values similar to the foo value of a given ID. Is there some easy way to do this in R?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ll assume you have a dataframe rather than a vector. Maybe something like this:
It will include in the output the given ID, but you can get rid of that if you need to, wrap it in a function, etc.