看板 R_Language 關於我們 聯絡資訊
[問題類型]: 程式諮詢 [軟體熟悉度]: 入門(寫過其他程式,只是對語法不熟悉) [問題敘述]: 各位前輩大家好,最近剛接觸R語言,在我的Win10上安裝,只要有寫到中文, 就會出現以下的錯誤訊息: In strsplit(code, "\n", fixed = TRUE) : input string 1 is invalid in this locale 找過網路上的解法,更改encodeing也沒有用,似乎很多班上同學也都是相同問題。 請問有人有相同經驗可以解答嗎? [程式範例]: 只要涉及到中文都或有類似問題 [環境敘述]: R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200) locale: [1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 [2] LC_CTYPE=Chinese (Traditional)_Taiwan.950 [3] LC_MONETARY=Chinese (Traditional)_Taiwan.950 [4] LC_NUMERIC=C [5] LC_TIME=Chinese (Traditional)_Taiwan.950 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] readr_1.1.0 loaded via a namespace (and not attached): [1] Rcpp_0.12.9 digest_0.6.12 rprojroot_1.2 assertthat_0.1 R6_2.2.0 [6] backports_1.0.5 magrittr_1.5 evaluate_0.10 stringi_1.1.2 rmarkdown_1.3 [11] tools_3.3.2 stringr_1.2.0 hms_0.3 rsconnect_0.7 yaml_2.1.14 [16] htmltools_0.3.5 knitr_1.15.1 tibble_1.2 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.133.116.173 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1493620229.A.B6A.html
HumuHumu: 存檔編碼改BIG5有用嗎? 05/01 19:37
cd12631: 不太建議用中文 很多東西只要中文就會有問題 05/02 00:32
andrew43: 用virtualbox建台linux,如果不能避免中文的話。 05/02 08:05
Ferdinand98: R預設語言是英文,若要解決上述問題,需要把預設語 07/10 10:21
Ferdinand98: 言調整為中文,加上以下程式就能解決 Sys.setlocate 07/10 10:21
Ferdinand98: (category="LC_ALL", locale="cht") 07/10 10:21
Ferdinand98: 以上是暫時的辦法,若再次開啟就失效,如果永久更改 07/10 10:21
Ferdinand98: 語言要去C槽Rconsole檔案,language修改為zh_TW 07/10 10:21