I'm trying to read data containing Japanese in Google Spreadsheet using R's gs_read, but it's garbled (for example, real estate → <U+5186>U+4E0D><U+52D5><U+7523>
). Who knows how to resolve this code?
library(googlesheets)
gs_ls()
data<-gs_key("The seat key is here")
data<-gs_read(data)
The gs_read
function in the googlesheets package provides optional arguments for reading text files in the readr package.
Why don't you specify the following argument for locale, which specifies the encoding?Please switch the encoding value according to your operating system.
library(readr)
# windows
gs_read(data, locale=locale(encoding="cp932"))
# unix series
gs_read(data, locale=locale(encoding="UTF-8")))
© 2024 OneMinuteCode. All rights reserved.