Similar to this one on dictionary in R, but my index (or key) is integer. So I have a vector c(1,1,44,44) and a mapping (1 -> US, 44 -> UK) and how can I get a vector of (US, US, UK, UK)?
The normal named vector method doesn't work.
> a = c('US','UK')
> names(a) = c(1, 44)
> a[44]
<NA>
NA