Learn R Programming

polyglotr (version 1.5.2)

google_translate: Translate text using google translate

Description

Translate text using google translate

Usage

google_translate(text, target_language = "en", source_language = "auto")

Value

Translated text.

Arguments

text

This is the text that you want to translate.

target_language

This is the language that you want to translate the text into. The default value for this argument is "en" for English.

source_language

This is the language of the text that you want to translate. The default value for this argument is "auto", which means that the function will try to automatically detect the language of the text.

Examples

Run this code
# \donttest{
google_translate("I love languages", target_language = "es")
text_to_translate <- c("the", "quick", "brown")
google_translate(text_to_translate, "fr", "en")
# }

Run the code above in your browser using DataLab