Friday, 15 March 2013

r - Encoding in Shiny -



r - Encoding in Shiny -

i'm working rstudio version 0.98.507. short info initial working instruments:

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 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

i have problem deploying shiny app on shiny server. problem @ point solved, after appears again. cannot prepare more. problem high german letters in helpers.r. unfortunately, cannot avoid using them. i'm sourcing help scrpits helpers.r server.r shown , taught in shiny tutorial. r-scripts saved under utf-8 format. cannot utilize command

options(encoding="utf-8")

because after executing it, command deployapp("app") doesn't work. set location using

sys.setlocale(category = "lc_all", locale = "german")

it doesn't work. cannot understand, why letters in mainpanel , sidebarlayout readable, helpers.r not. can help me solve paradox?

example

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") ) ) ))

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") }) })

after deploying next app.

as workaround (which haven't tested), have tried using escaped unicode characters, such "w\u00e4hrung" instead of "währung"? can can find details of how ?quotes, , there list of unicode characters @ http://en.wikipedia.org/wiki/list_of_unicode_characters.

r utf-8 shiny shiny-server

No comments:

Post a Comment