2015-10-29 50 views
1

我的同事Shiny用户!我无法在Shiny表格输出中渲染希腊字母。请注意,我知道如何使用HTML功能在Shiny中打印希腊字母。请参阅下面的代码片段。在桌面上呈现希腊字母闪亮的应用程序

这是ui.R:

library(shiny) 

shinyUI(pageWithSidebar(

    headerPanel("A sample"), 

    sidebarPanel(
    numericInput(
     inputId = "alpha", 
     label = HTML("α:"), 
     value = 0.05, 
     step = 0.01 
    ) 
), 

    mainPanel(
    plotOutput("samplePlot") 
) 
)) 

这是server.R:

shinyServer(function(input, output) { 
    output$samplePlot <- renderPlot({ 
    hist(c(1:100), main = "A Sample Plot", xlab = "Whatever") 
    }) 
}) 

这工作得很好,给我在滑块希腊字母。但是,我希望在我的表格输出中也有希腊字母,但类似的方法似乎不起作用...请参阅下面的代码。

这是ui.R:

library(shiny) 

shinyUI(pageWithSidebar(

    headerPanel("A sample"), 

    sidebarPanel(
    numericInput(
     inputId = "alpha", 
     label = HTML("&alpha;:"), 
     value = 0.05, 
     step = 0.01 
    ) 
), 

    mainPanel(
    plotOutput("samplePlot"), 
    tableOutput("myTable") 
) 
)) 

这是server.R:

shinyServer(function(input, output) { 
    output$samplePlot <- renderPlot({ 
    hist(c(1:100), main = "A Sample Plot", xlab = "Whatever") 
    }) 

    output$myTable <- renderTable({ 
    data.frame(alpha = HTML("&alpha;:"), value = 3) 
    }) 
}) 

如何获得在表输出的阿尔法列打印出来的希腊阿尔法任何想法。感谢任何帮助!

回答