[問題] shiny deploy 中文問題

作者: swedrf0112 (M)   2015-06-02 22:51:06
[問題類型]:程式諮詢
[軟體熟悉度]:入門
[問題敘述]:
在 RStudio中直接Run App 可以正常顯示中文 http://miupix.cc/pm-6FRMG9
但按publish deploy去shinyapps.io後,會出現 http://miupix.cc/pm-HJYUTX
已經試過在RStudio內Save with Encoding將ui.R server.R轉成UTF-8
以及將兩個檔案用Notepad++ 轉成UTF-8(BOM)再上傳都無法順利解決囧
麻煩各位了!!謝謝!!
[程式範例]:
## ui.R
library(shiny)
shinyUI(
fluidPage(
radioButtons("Buttons","qq",list("b1"="qqq","b2"="aaa","b3"="zzz"))
,mainPanel(
plotOutput("vvv")
,dataTableOutput("test")
)
)
)
## server.R
library(shiny)
shinyServer(
function(input,output){
output$vvv=renderPlot({
if(is.null(input$Buttons)==FALSE){
switch(input$Buttons
,qqq={plot(rnorm(100,0,1),axes=F,main="哈囉你好")
axis(1)}
,aaa=plot(rchisq(100,1))
,zzz=plot(x=1,y=1))
}
})
output$test=renderDataTable({
if(is.null(input$Buttons)==FALSE){
switch(input$Buttons
,qqq=as.data.frame(c("aa"))
,aaa=as.data.frame(c("bb")))
}
})
}
)
[環境敘述]:
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
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
other attached packages:
[1] shiny_0.12.0
loaded via a namespace (and not attached):
[1] bitops_1.0-6 digest_0.6.8 htmltools_0.2.6 httpuv_1.3.2
jsonlite_0.9.16
[6] mime_0.3 R6_2.0.1 Rcpp_0.11.6 RCurl_1.95-4.6
RJSONIO_1.3-0
[11] rstudio_0.98.1017 rstudioapi_0.3.1 shinyapps_0.3.64 tools_3.1.1
xtable_1.7-4
[關鍵字]: shiny deploy 中文
作者: Wush978 (拒看低質媒體)   2015-06-03 01:46:00
參考看看 #1KeBgh7h
作者: swedrf0112 (M)   2015-06-03 19:53:00
wush大~ 今天測試在自己的ubuntu shiny server上使用沒問題 可是deploy還是不行也試過用vi存一份新的 再deploy也是失敗 Orz...
作者: Wush978 (拒看低質媒體)   2015-06-03 23:20:00
deploy的機器的環境變數要檢查一下喔locale相關的安裝也都要走一遍

Links booklink

Contact Us: admin [ a t ] ucptt.com