【发布时间】:2019-02-15 20:18:50
【问题描述】:
是否可以制作一个反应性的闪亮输出,直接显示用户鼠标指向的内容?
为了说明,在以下可复制的示例中,我希望这个 Shiny 应用程序无需单击即可打印鼠标光标下方的内容。
library(shiny)
ui <-fluidPage(
titlePanel("Transports"),
sidebarLayout(
sidebarPanel(
selectInput("var",
label = "Variable to display when user moves the mouse over it",
choices = c("car", "boat","plane"),selected = "car")
),
mainPanel(
textOutput("selected_var")
)
)
)
server <- function(input, output) {
output$selected_var <- renderText({
paste("You have selected the", input$var)
})
}
shinyApp(ui = ui,server = server)
提前致谢
【问题讨论】:
标签: r shiny selection selectize.js