Last active
April 18, 2022 09:51
-
-
Save madilk/a7e5f68f8fe29683ed98c0ac272e1a2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
translation <- | |
gl_translate( | |
data$comments, | |
target = "en", | |
format = c("text"), | |
source = "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I got the error "Error in nchar(t_string) : invalid multibyte string, element 800" with my data.