[爆卦]r shiny中文是什麼?優點缺點精華區懶人包

為什麼這篇r shiny中文鄉民發文收入到精華區:因為在r shiny中文這個討論話題中,有許多相關的文章在討論,這篇最有參考價值!作者samex4x4 (Same)看板R_Language標題[問題] shiny io 中文顯示問...



[問題類型]:

程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)


[軟體熟悉度]:
請把以下不需要的部份刪除
入門(寫過其他程式,只是對語法不熟悉)

[問題敘述]:
大家好我又來了m(_ _)m
最近在使用shiny為公司寫給行銷人員使用的報表

之前就發現有中文顯示問題
估狗後增加一個global.R
內容為 options(shiny.usecairo = FALSE)

但還是無法掛上shiny io
錯誤訊息大概都是這樣

Failed to lint file 'server.R'
The linter failed with message:

invalid multibyte string at '<e7><99><bc>?欧㕑") %>%'
Failed to lint file 'ui.R'
The linter failed with message:

invalid multibyte string at '<e7><99><bc>?<87>','
Failed to lint file 'server.R'
The linter failed with message:

查看warnings()
Warning messages:
1: In gregexpr("../", content, fixed = TRUE) :
input string 112 is invalid in this locale
2: In gregexpr("../", content, fixed = TRUE) :
input string 138 is invalid in this locale
...
...
...

都是我寫中文的行數

想詢問大家要如何解決

謝謝


[程式範例]:


[環境敘述]:

R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 LC_CTYPE=Chinese
(Traditional)_Taiwan.950
[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950 LC_NUMERIC=C

[5] LC_TIME=Chinese (Traditional)_Taiwan.950

attached base packages:
[1] stats graphics grDevices utils datasets methods base


[關鍵字]:
shiny io 中文顯示


--
So we beat on, boats against the current, + .
borne back ceaselessly into the past. . + .
-F. Scott Fitzgerald <The Great Gatsby> .
於是我們繼續往前掙扎,像逆流中的扁舟, ◢
被浪頭不斷地向後推入過去。 ▁▂▁ ▁▂▂▂▂▁ ◥▇◤
▆▅▅▄▄▅▆▇▇▇ -F. 史考特‧費滋傑羅 <大亨小傳>███▇▇▆▅▆▇▄▅▆▇█

--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 210.63.206.33
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1479700332.A.CE4.html
clansoda: 我猜就是不能用中文,我寫的shinyapp只要有中文 11/21 12:37
clansoda: shinyio連掛都不給我掛 11/21 12:37
我是參考這份
http://shiny.leg.ufpr.br/daniel/022-unicode-chinese/
我有另外寫一個英文版QQ
但是有些訊息一定要顯示中文才能給行銷做判斷
所以滿苦惱的 只能往server端前進了嗎
abc2090614: 直接寫信去問RStudio的Yihue Xie吧 11/21 16:04
samex4x4: 謝益輝大大嗎XD 11/21 17:29
abc2090614: 有夠多人幹譙他們就會增加中文支援了啊XD 11/22 01:33
psinqoo: 我建議 公司報表 不要上傳 io 自己架站~ io 有時數限制 11/22 08:56
psinqoo: 超過多錢~ 加上中文顯示是一個問題~ 11/22 08:57
psinqoo: 我已經放棄 IO~ 直接架站~ 在內部內網 連SQL也相對安全 11/22 08:59
未來應該會架站,這也是之後彙整一些資料會比較方便的模式,就在等公司回復XD
原來io有時數限制(驚)
大概有多久啊??
clansoda: 網站上面有寫 印象中25小時? 11/22 09:10
rodion: 可以中文吧? https://rkan.shinyapps.io/SHY_draft/ 11/22 10:05
想詢問怎麼解決QQ 目前是我一有中文就掛失敗
我是3.3.2版
also5566: 我自己的經驗是UI.R可以有中文,server.R不行 11/22 15:23
also5566: 樓上那個可能也是UI.R中有中文,server.R沒有 11/22 15:24
also5566: 你如果只是要給其他人方便使用,server.R應該可以用英 11/22 15:25
also5566: 文寫吧,不知道我有沒有誤解你的問題@@ 11/22 15:25
因為輸出Table有一欄中文可能會有一些亂碼,所以都會error...
擷取來源是FB的發文內容
ching0629: 試試先打options(encoding = "UTF-8")後再上傳 11/22 18:22
ching0629: https://ychuang.shinyapps.io/HANI_zhTW/ 11/22 18:26
嘗試之後連跑在本機都會失敗(汗
試過Save with Encoding > UTF-8 沒有用...
現在的encoding 是"native.enc"

我把本機的vm開起來試著在ubuntu的情況下跑跑看好了
rodion: 嗨 原PO 我剛上傳server.R ui.R到github repo了 11/22 19:17
rodion: repo網址:https://github.com/r-kan/Quant-in-R 11/22 19:19
rodion: 給你參考看看 還是不行的話再來討論 11/22 19:19
rodion: 另外R版本3.3.1 作業系統:OSX 10.11.2 11/22 19:42
感謝Q__Q 我明天再試一次,今天只有把程式碼放在公司電腦
※ 編輯: samex4x4 (36.224.0.205), 11/22/2016 20:59:49
還是都error ^^|||
謝謝大家幫我想了這麼多辦法,我還是爽快的去架server了
未來公司也會傾向這塊
希望這帖可以幫助其他有相同問題的人~~~
※ 編輯: samex4x4 (210.63.206.33), 11/23/2016 11:16:37
※ 編輯: samex4x4 (210.63.206.33), 11/23/2016 11:28:49

你可能也想看看

搜尋相關網站