[問題] R的actionbutton應用
最近打好一串程式是能夠讀取到某資料夾的內容能夠顯示出來
((以下是能夠自己讀檔的方式
setwd("C:/home/user521/桌面/0519/545")
getwd()
list.files() # dir()
(filenames <- list.files(".", pattern="*.csv"))
(quiz.data <- lapply(filenames, read.table))
但現在想更進一步就是利用shiny方式 然後按按鍵之後就能夠讓檔案自動讀取
想請問該如何更改
以下是Server端
shinyServer(function(input, output) {
output$plot1 <- renderPlot({
# Simply accessing input$goButton here makes this reactive
# object take a dependency on it. That means when
# input$goButton changes, this code will re-execute.
input$goButton
# Use isolate() to avoid dependency on input$n
isolate({
hist(rnorm(input$n))
})
})
})
想問是不是要從input$goButton 這邊下去做更改 還是render方面該如何做修改
我們想讓按鈕按下去程式才會運作 而不是程式直接運作
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.82.10.206
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1505973444.A.AE3.html
→
09/21 14:02, , 1F
09/21 14:02, 1F
※ 編輯: s1032901 (111.82.10.206), 09/21/2017 14:29:45
→
09/21 14:46, , 2F
09/21 14:46, 2F
→
09/21 14:47, , 3F
09/21 14:47, 3F
→
09/21 14:49, , 4F
09/21 14:49, 4F
→
09/21 16:08, , 5F
09/21 16:08, 5F