在闪亮的,我有以下内容:
output$sequenceText <- renderText({
showSequence()
})
showSequence <- reactive({
selectedSeqs <- as.numeric(input$sequenceSelect)
resultString <- ""
currentString <-""
for(i in selectedSeqs){
currentString <- paste(i, toString(myProts[i]), sep = ":")
resultString <- paste(resultString, currentString, sep = "\n")
}
return(resultString)
})
然而,似乎并没有尊重新线角色。我该如何解决这个问题?
Thanks!
据我所知,只有两个选项可以在闪亮中显示多行。一种使用方法verbatimTextOutput
这将在您的文本周围提供一个灰色框(个人喜好)。另一种是使用renderUI
and htmlOutput
使用原始 html。这是一个演示结果的基本工作示例。
require(shiny)
runApp(
list(
ui = pageWithSidebar(
headerPanel("multi-line test"),
sidebarPanel(
p("Demo Page.")
),
mainPanel(
verbatimTextOutput("text"),
htmlOutput("text2")
)
),
server = function(input, output){
output$text <- renderText({
paste("hello", "world", sep="\n")
})
output$text2 <- renderUI({
HTML(paste("hello", "world", sep="<br/>"))
})
}
)
)
得出下图:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)