I'm looking for a way - if there is any - to use a Stata syntax file in R. I have a dataset that contains country names and a Stata .do file that can translate the names into cow country codes:
USA = 1
Afghanistan = 700
Is there any why I can use that file with R or do I need to find someone with Stata to do it for me?
Any help is greatly appreciated, thank you :)
EDIT:
The .do file is plaintext, I can open it in Chrome or Textmate.
It looks like this:
capture drop gwno
gen gwno=.
replace gwno= 700 if country== "Afganistan"
replace gwno= 700 if country== "Afghanistan"
replace gwno= 700 if country== "AFGHANISTAN"
replace gwno= 339 if country== "Albania"
replace gwno= 615 if country== "Algeria"
replace gwno= 232 if country== "Andorra"
replace gwno= 540 if country== "Angola"
replace gwno= 58 if country== "Antigua & Barbuda"
...