我有一个有多个用户的闪亮程序。我已经在每个用户登录后编码成对。他们有一个值,当两者都是“准备好”时会更新
Participants[Group] <- list(
Person1=list(Ready=FALSE, value=0),
Person2=list(Ready=FALSE, value=0))
我希望我的代码只有在两个成员都提交了他们的输入后才能执行。例如,
sliderInput("value",min=1,max=3)
actionButton("enter")
ReactParts <- reactiveValues()
ReactParts$Participants <- Participants
observeEvent( input$enter, {
if( all(
sapply(Participants[Group], function(i){i$Ready == TRUE}) ) )
{
ReactParts$Participants[Group]$value <- input$value
} ## else { do nothing}
})
处理组中所有个人的输入的最佳方法是点击enter
?