Skip to content

Instantly share code, notes, and snippets.

@madilk
Last active April 18, 2022 09:51
Show Gist options
  • Save madilk/a7e5f68f8fe29683ed98c0ac272e1a2e to your computer and use it in GitHub Desktop.
Save madilk/a7e5f68f8fe29683ed98c0ac272e1a2e to your computer and use it in GitHub Desktop.
translation <-
gl_translate(
data$comments,
target = "en",
format = c("text"),
source = "")
install.packages("googleLanguageR")
library(googleLanguageR)
gl_auth("C:\\folder-where-json-file-is-placed\\service-key.json")
data<- Nl_sample_data
head(data)
View(data)
translation <-
gl_translate(
data$comments,
target = "en",
format = c("text"),
source = "")
?gl_translate
translation
View(translation)
combinedData<- cbind(data,translation)
View(combinedData)
#delete duplicate column
cleanData <- subset(combinedData,select=-text)
View(cleanData)
@Moonmanifesting
Copy link

Hi, I got the error "Error in nchar(t_string) : invalid multibyte string, element 800" with my data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment