Using “cat” to write non-English characters into a .html file (in R)

前端 未结 3 1934
野的像风
野的像风 2021-01-21 08:33

Here is the code showing the problem:

myPath = getwd()
cat(\"abcd\", append = T, file =paste(myPath,\"temp1.html\", sep = \"\\\\\")) # This is fine
cat(\"
3条回答
  •  抹茶落季
    2021-01-21 09:02

    Try it this way

    cat("abcd", file = (con <- file("temp1.html", "w", encoding="UTF-8"))); close(con)
    

提交回复
热议问题