Latex,RenderTable in Shiny,R [英] Latex, RenderTable in Shiny, R

查看:80
本文介绍了Latex,RenderTable in Shiny,R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想在Shiny的表中获取$\10^{-1}$,但是它不起作用.我正在尝试以下代码(预先感谢):

I just trying to get $\10^{-1}$ in a table in Shiny, but it is not working. I'm trying the following code (thanks in advance):

ui.R :

require(shiny)  
shinyUI(tableOutput('mytable') 
)

server.R :

  require(shiny)  
shinyServer(function(input, output){  
output$mytable <- renderTable({  
df <- data.frame(A = c("$\\10^{-1}$", 33.1, 6),B = c(111111, 3333333, 3123.233))  
df  
  }, sanitize.text.function = function(x) x)
})

推荐答案

您可以在闪闪发亮的环境中使用mathJAX:

You can use mathJAX in shiny:

require(shiny)  
ui <- shinyUI(
  fluidPage(
    withMathJax()
    , h2("$$\\mbox{My Math example }\\sqrt{2}$$")
    , tableOutput('mytable')
    )
)
server <- function(input, output, session){  
  output$mytable <- renderTable({  
    df <- data.frame(A = c(HTML("$$\\alpha+\\beta$$"), 33.1, 6),B = c(111111, 3333333, 3123.233))  
    df  
  }, sanitize.text.function = function(x) x)
}

shinyApp(ui = ui, server = server)

这篇关于Latex,RenderTable in Shiny,R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆