先上code
<br />
# ui.r<br />
library(shiny)<br />
shinyUI(pageWithSidebar(<br />
headerPanel("标题"),</p>
<p> sidebarPanel(</p>
<p> checkboxInput(inputId = "show", label = "show:", value = TRUE),<br />
conditionalPanel(<br />
condition = "input.show == true",<br />
radioButtons("row", "row numbers:",<br />
list("1" = "1",<br />
"2" = "2",<br />
"3" = "3"))<br />
)<br />
),</p>
<p> mainPanel(<br />
conditionalPanel(<br />
condition = "input.show == true",<br />
tableOutput("myTable")<br />
)<br />
)</p>
<p>))<br />
</p>
<br />
# server.r<br />
library(shiny)</p>
<p>shinyServer(function(input, output) {</p>
<p> output$myTable <- renderTable({<br />
head(data.frame(x = c("中文","b","c"), y = 1:3, z = 6:8),input$row)<br />
})</p>
<p>})<br />
</p>
标题上的中文可以正常显示,但是表格中的中文就会自动转成ansi编码格式了。
求助这个怎么解决?