goodworry
应该不是key的问题,我换了别的工具,是能用的,换回到这个包就不行了
按照作者提供的方法
> if (!file.exists("~/.Renviron")) {
+ file.create("~/.Renviron")
+ }
[1] TRUE
>
> file_path = "~/.Renviron"
> file = file(file_path, open = "a")
>
> comment = "# ID and PASSWORD of Youdao Translation"
> writeLines(comment, file)
>
> code_lines = c(
+ "app_key = \"my key\"",
+ "app_secret = \"my secret\""
+ )
>
> for (code in code_lines) {
+ writeLines(code, file)
+ }
>
> close(file)
> read_lines("~/.Renviron")
[1] "# ID and PASSWORD of Youdao Translation" "app_key = \"my key\""
[3] "app_secret = \"my secret\""
> library(ecce)
> translate("I like R language")
Error in translate("I like R language") :
You need to provide the ID and PASSWORD of the Youdao API.