And*_*d_R 12 r utf-8 shiny shiny-server
我正在使用RStudio版本0.98.507.关于初始工作工具的简短信息:
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
other attached packages:
[1] shinyapps_0.3.53 RJSONIO_1.2-0.2 shiny_0.9.1.9013
loaded via a namespace (and not attached):
[1] bitops_1.0-6 Cairo_1.5-5 caTools_1.17 digest_0.6.4
[5] htmltools_0.2.4 httpuv_1.3.0 Rcpp_0.11.1 RCurl_1.95-4.1
[9] shinysky_0.1.2 tools_3.1.0 xtable_1.7-3
Run Code Online (Sandbox Code Playgroud)
通过在闪亮的服务器上部署我的闪亮应用程序,我遇到了问题.问题在某种程度上解决了,但在它再次出现之后.现在我无法解决它了.我的问题是helpers.R中的德语字母.不幸的是,我无法避免使用它们.我正在将我的帮助scrpits helpers.R 发送到server.R,就像它在Shiny Tutorial中展示和教授一样.我的所有R脚本都以UTF-8格式小心保存.我无法使用该命令
options(encoding="UTF-8")
Run Code Online (Sandbox Code Playgroud)
因为在执行它之后,命令deployApp("app")不起作用.我使用设置位置
Sys.setlocale(category = "LC_ALL", locale = "German")
Run Code Online (Sandbox Code Playgroud)
它也行不通.我无法理解,为什么mainPanel和sidebarLayout中的字母是可读的,但是来自helpers.R的字母不是.有人可以帮我解决这个悖论吗?
例
ui.R
library(shiny)
shinyUI(fluidPage(withMathJax(),
titlePanel("Währung"),
sidebarLayout(position="right",
sidebarPanel(
h5("Bedienfenster"),
sliderInput('x', 'x axis',
value=50, min=3, max=150, step=1,)
),
mainPanel(
plotOutput("Plot")
)
)
))
Run Code Online (Sandbox Code Playgroud)
server.R
shinyServer(function(input, output){
output$Plot <- renderPlot({
x <- rnorm(input$x)
hist(x, main="", xlab="", ylab="")
title(main="Schätzgerade", xlab="Währung", ylab="Dichte")
})
})
Run Code Online (Sandbox Code Playgroud)
部署后,我得到以下应用程序.
作为一种解决方法(我还没有测试过),您是否尝试过使用转义的Unicode字符,"W\u00E4hrung"而不是"Währung"?您可以?Quotes在http://en.wikipedia.org/wiki/List_of_Unicode_characters找到有关如何执行此操作的详细信息,并且有一个Unicode字符列表.