Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 光泽输入中的乳胶_R_Shiny_Latex - Fatal编程技术网

R 光泽输入中的乳胶

R 光泽输入中的乳胶,r,shiny,latex,R,Shiny,Latex,我想知道是否有人知道如何在一个闪亮的selectInput()命令中包含LaTeX代码。我想做一些类似的事情: ui <- shinyUI( fluidPage( selectInput( c("$\mu_0 \leq 3$" = "less", "$\mu_0 \geq 3" = "more", "$\mu_0 = 3" = "equal" ) ) ) server <- funct

我想知道是否有人知道如何在一个闪亮的selectInput()命令中包含LaTeX代码。我想做一些类似的事情:

ui <- shinyUI(
  fluidPage(
       selectInput(
        c("$\mu_0 \leq 3$" = "less",
          "$\mu_0 \geq 3" = "more",
          "$\mu_0 = 3" = "equal"
        )
    )
)

server <- function(input, output, session){  
      # server side code here...
}

shinyApp(ui = ui, server = server)

ui这样的东西对你有帮助吗

selectInput("mean", label = "Parameter", choices=c("\u03BC"="mu"))

您可以使用katex

library(shiny)

choices <- c("less", "more", "equal")
choicesNames <- c("\\\\\\mu_0 \\leq 3", 
                  "\\\\\\mu_0 \\geq 3",
                  "\\\\\\mu_0 = 3")
choices <- setNames(choices, choicesNames)

ui <- shinyUI(
  fluidPage(
    tags$head(
      tags$link(rel="stylesheet", 
                href="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css", integrity="sha384-9tPv11A+glH/on/wEu99NVwDPwkMQESOocs/ZGXPoIiLE8MU/qkqUcZ3zzL+6DuH", 
                crossorigin="anonymous"),
      tags$script(src="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.js", integrity="sha384-U8Vrjwb8fuHMt6ewaCy8uqeUXv4oitYACKdB0VziCerzt011iQ/0TqlSlv8MReCm", 
                  crossorigin="anonymous")
    ),
    selectizeInput(
      "ID", 
      "LABEL", 
      choices,
      options = list(render = I("
    {
      item: function(item, escape) { 
              var html = katex.renderToString(item.label);
              return '<div>' + html + '</div>'; 
            },
      option: function(item, escape) { 
                var html = katex.renderToString(item.label);
                return '<div>' + html + '</div>'; 
              }
    }"))
    )
  )
)

server <- function(input, output, session){  
    # server side code here...
}

shinyApp(ui = ui, server = server)
库(闪亮)
选择