I have this series of nested statements
data$Country == 1,"Brazil",
ifelse(data$Country == 2, "Canada",ifelse(
data$Country == 3, "China",ifelse(
data$Country == 4, "Ecuador",ifelse(
data$Country == 5, "France",ifelse(
data$Country == 6, "Germany",ifelse(
data$Country == 7, "India",ifelse(
data$Country == 8, "Italy",ifelse(
data$Country == 9, "Mexico",ifelse(
data$Country == 10, "Nigeria",ifelse(
data$Country == 11, "Poland",ifelse(
data$Country == 12, "Russia",ifelse(
data$Country == 13, "South Africa",
ifelse(
data$Country == 14, "South Korea",ifelse(
data$Country == 15, "Singapore",
ifelse(
data$Country == 16, "Spain",
ifelse(
data$Country == 17, "Sweden",ifelse(
data$Country == 18, "United Kingdom",ifelse(
data$Country == 19, "United States","l"
))))))))))))))))))))
I was looking for the quickest way to convert any encoded variable into the respective Country name. Do you think is there a way to cope with this operation?
Thank you so much