Hi everyone,
I have a lot of countries (written as country names (string), example: Albania, no country codes) in my data and I want to generate a variable called region that categorizes them into 5 regions (1=Europe, 2= Middle East, 3=Asia, 4=Africa, 5=Americas). However, I can only do it one "replace" command per country which is tedious. I'm sure there's a more efficient way that I'm not aware of. Any help?
Many thanks,
Yasmine
I have a lot of countries (written as country names (string), example: Albania, no country codes) in my data and I want to generate a variable called region that categorizes them into 5 regions (1=Europe, 2= Middle East, 3=Asia, 4=Africa, 5=Americas). However, I can only do it one "replace" command per country which is tedious. I'm sure there's a more efficient way that I'm not aware of. Any help?
Many thanks,
Yasmine

Comment