I have a data set with country names and exports, but the country names are in Spanish. I want to use countrycode to get the proper codes to map it, however countrycode only converts from English/German to other languages (not the other way around). I tried using translateR to change the Spanish names to English, but the new column outputs the exact same thing as the original.
I don't think it is my API because I was getting a different error for that originally, but then I restarted R and it went away. Is it something in the code?
#read in file
data <- read.csv("...", header = TRUE)
data$char <- as.character(data$pais_descripcion)
#translate
library(translateR)
google.dataset.out <- translate(dataset = data,
content.field = 'char',
google.api.key = 'key',
source.lang = 'es',
target.lang = 'en')