【发布时间】:2017-12-30 07:19:27
【问题描述】:
我有一个反应对象,当用户单击 GO 按钮时我想修改它。我尝试了这段代码,Per 给出了很好的结果。
现在考虑到第一个,我想做不止一个修改,所以每次修改时我都应该保存RA_s。
我该如何处理这个问题?
代码
shinyServer(function(input, output) {
RA_s <- reactive({
read.csv("C:/alay/Desktop/RA.csv")
})
Per <- reactive({
if(input$go == 0) return(RA_s())
else {
c = RA_s()
c[1] = rep(0,nrow(RA_s()))
}
c
})
})
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Download", tabName = "d")
)
body<- dashboardBody(
tabItems(
tabItem(tabName = "d",
actionButton("go",'GO!') )
)
dashboardPage(
dashboardHeader(title = "Valo"),
sidebar,
body
)
【问题讨论】: