This may depend on where the data is coming from. Are you reading data from a csv file, a database, etc?
Otherwise you could recode the vector. See for example dyplr recode
Could you supply some sample data? A handy way to supply sample data is to use the dput() function. See ?dput. If you have a very large data set then something like head(dput(myfile), 100) will likely supply enough data for us to work with.