2016-05-30 52 views
0

Shiny提供了withMathJax()函數來顯示UI中的公式。閃亮的用戶界面:`withMathJax()`在radioButton和checkboxGroupInput中

我想顯示一些數學wihtin複選框和/或單選按鈕選項 - 但不要讓它工作。

小例子

require(shiny) 
runApp(
    list(ui = pageWithSidebar(

    headerPanel(withMathJax("$$\\text{Here it works }X_n=X_{n-1}-\\varepsilon$$")), 

    sidebarPanel(radioButtons("test", withMathJax("$$\\text{Here it works too }X_n=X_{n-1}$$"), 
           choices = c(paste(withMathJax("$$\\text{Here it doesn`t work }X_n=X_{n-1}$$"), "= test"), 
              "Rohe Skalierung"  = "raw", 
              "Ueber alle Werte"  = "std", 
              "Innerhalb der Personen" = "gstd"))), 

    mainPanel() 
), 
    server= function(input, output, session){ 

    } 
) 
) 

回答

0

反覆試驗,由corresponding RStudio shiny gallery example啓發使我以下解決方案:

require(shiny) 
runApp(
    list(ui = pageWithSidebar(

    headerPanel(withMathJax("$$\\text{Here it works }X_n=X_{n-1}-\\varepsilon$$")), 

    sidebarPanel(withMathJax(), radioButtons("test", "\\(X_n=X_{n-1}\\)", 
           choices = c("\\(X_n= \\text{And Here it works to }X_{n-1}\\)"  = "test", 
              "Rohe Skalierung"   = "raw", 
              "Ueber alle Werte"  = "std", 
              "Innerhalb der Personen" = "gstd"))), 

    mainPanel() 
), 
    server= function(input, output, session){ 

    } 
) 
) 
相關問題