I have a Stata dataset (.dta file) that contains one variable, RGA (this is a MWE, I actually have tons of variables). This variable takes 3 factor values: 1, 2 and 3. These factors refer to meaningful things (so-called "value labels") and the association between the factors and their value labels is in a separate .txt Stata-like file, fully reproduced here:
. label define RGA_l
1 "meaning of 1"
2 "meaning of 2"
3 "meaning of 3"
. label values RGA RGA_l
I load my .dta file into R through the haven
package. I would like to have an easy access to the value labels of RGA within R, notably to be able to quickly match RGA's values with their value label to produce readable output. How can I read this separate .txt file into R in a way that I can match it with my dataset?