How to replace the tag value with the corresponding actual value in R?

It sounds like you are looking for a "join" operation, take a look at the dplyr package.

That is because the preferred method for asking questions here is with a proper Reproducible Example, take a look at this guide to learn how to create one.