This question is very similar to these two posts: How to compare values with a reference table in R? and Combine Table with reference to another table in R . However, mine is mo