記錄一下go button的作用
histo <- eventReactive(input$gobutton,{
ggplot(faithful, aes(eruptions))+
geom_histogram(bins = as.numeric(input$n_breaks))
})
簡(jiǎn)單來說,就是eventReactive里面,先加一個(gè)input$gobutton,起到隔離的作用
還有一個(gè)是observeEvent功能,應(yīng)該就是某個(gè)事件發(fā)生后觸發(fā)的事情,例如:
observeEvent(input$plot1_dblclick, {
brush <- input$plot1_brush
if (!is.null(brush)) {
ranges$x <- c(brush$xmin, brush$xmax)
ranges$y <- c(brush$ymin, brush$ymax)
} else {
ranges$x <- NULL
ranges$y <- NULL
}
})
就是{}中的事件,在雙擊即input$plot1_dbclick之后才會(huì)表現(xiàn)出來