在下面的应用程序中,我试图打印paste()结果,但我得到"shiny-text-output noplaceholder"
错误。
library(shiny)
library(shinyWidgets)
library(shinydashboard)
centers<-structure(list(State = "Alabama", Y = 32.7760928445334, X = -86.830460056472), row.names = 20L, class = "data.frame")
#dashboard
ui <- dashboardPage(
dashboardHeader(title="Mock up"),
#sidebar
dashboardSidebar(
collapsed = T
),
#body
dashboardBody(
paste("LONGITUDE:",verbatimTextOutput("v1"),"LATITUDE:",verbatimTextOutput("v2")),
)
)
#server part
server <- function(input, output) {
output$v1<-renderText({
#centers<-subset(centers,State%in%input$p3)
centers[1,2]
})
output$v2<-renderText({
#centers<-subset(centers,State%in%input$p3)
centers[1,3]
})
}
shinyApp(ui, server)
字符串
1条答案
按热度按时间rjee0c151#
您必须返回
renderText
内部的字符串。将paste
重新排列为renderText
,并在dashboardBody
中仅使用verbatimTextOutput
。的数据
字符串