在下面的以下 R 闪亮代码中,我试图嵌入两个左右对齐的框,左框上方的 selectInput 小部件,当我们单击按钮时,整个内容出现在 bsmodal 弹出窗口中。但是,我无法获得所需的结果,请帮助我进行调整,以便我可以在单击按钮时显示它。谢谢
library(DT)
library(shiny)
library(shinyBS)
ui <- basicPage(
h2("The mtcars data"),
column(5,offset = 5,actionButton("CR1_S1", "Button")),
mainPanel(
bsModal("modalExample", "Your Table", "CR1_S1", size =
"large",uiOutput("mytable"))))
server <- function(input, output) {
output$mytable <- renderUI({
selectInput("variable", "Variable:",
c("Cylinders" = "cyl",
"Transmission" = "am",
"Gears" = "gear"))
box(
title = "Title 1", width = NULL, solidHeader = TRUE, status = "primary",
plot(iris$Sepal.Length))
box(
title = "Title 2", width = NULL, solidHeader = TRUE, status = "primary",
plot(iris$Petal.length))})
}
shinyApp(ui, server)