有没有办法在文本中显示R对象?我希望Shiny输出像
``你的对象是◼,,(绿色三角形)''
我认为代码看起来像
h2("Your Object is" )
renderIcon(pch=16, col=1)
答案 0 :(得分:1)
它并不理想,但您可以使用intToUtf8()
在文本中插入特定形状,然后用跨度对其进行着色。有关几何形状的Unicode代码,请参阅此链接:https://www.w3schools.com/charsets/ref_utf_geometric.asp
library(shiny)
ui <- fluidPage(
h2("Your Object is: ",
span(style="color: green;", intToUtf8(9650)))
)
server <- function(input, output, session) { }
shinyApp(ui, server)