我想使用 R SHiny 制作一个简单的 Web 应用程序,在其中我通过提供路径并在单击按钮时将其显示在我的网页上来从硬盘驱动器加载图像。
我首先对文本执行此操作,例如显示路径,但是当我单击时我的按钮没有反应(我的意思是说它不打印消息)。
服务器.R:
shinyServer(function(input, output, session) {
dt<-reactive({
output$text1 <- renderText({
paste("You have selected", input$obs)
})
})
})
ui.R:
shinyUI(pageWithSidebar(
headerPanel("Fruits and vegetables!"),
sidebarPanel(
helpText("What do you see below?"),
#imageOutput(outputId="images/1.png")
numericInput("obs", "Number of observations to view:", 10),
actionButton("get", "Get")
),
mainPanel(textOutput("text1"))
))