我用shinydashboard建立了一个应用程序,并试图生成一个带有(反应式)文本的盒子。我在dashboardBody中的代码是
box("Species was found in ", textOutput("Count1"), "of", Count2, "Sites")
Count1是被动的,基于UI中的用户输入。Count2是在global.R中定义的。
输出是。
Species was found in
1
of 134 Sites
那么,我如何删除换行符呢? paste()不能工作,因为它只显示textoutput元素的html代码。
根据评论,它确实工作,所以这里我的解决方案作为一个答案。
box("Species was found in ", textOutput("Count1", inline = TRUE), "of", Count2, "Sites")
没有 inline = TRUE
它把 textOuput()
在...中 div
所以,这就产生了换行符。