Hey everyone,

Is there a simple command (or few lines of code) to rename variables based on a specific string value they hold?

In more detail, the situation is that I have an elections results data set in which every variable is a "party", and the values it holds represent the amount of votes for that party. the problem is that variables are named by the letters represent each party on the ballots. I would like to rename the variables so that they indicate the parties' names. For doing that, I have another small table that has the same unwanted names (the representing letters) as variable names, but under each of them there is a string value of the party's real name.

Any ideas how to deal with this issue?

Much appreciation,
Ben