In R code I have a character variable var that has values \"AA\", \"AB\", \"AC\", etc.
var
str(var) chr [1:17003] \"AA\" \"AA\" \"AA\" \"AA\" \"AB\"
you can use them by directly converting them into factors with labeling.
x$Country = factor(x$Country, levels = c('AA', 'AB', 'AC'), labels = c(1, 2, 3))