2
我有一个问题,插入一个闪亮的表中的值的向量。问题是它总是将矢量的最后一个条目保存到我尝试操纵的所有单元格中。 例如:闪亮的输出变量中的重复值
outValues <- c(368,331,334,443,348,324,608,376,354,706)
stations <- c("Station_Electric_Testing_PLx","Station_Wall_Polishing",
"Station_Dicing_Grooving","Station_Coating",
"Station_Electric_Testing_PL","Station_PhotoLitho",
"Station_Face_Polishing","Station_Anealling",
"Station_CleaningAfter_45","Station_45_Cutting",
"Station_Kupelevitz")
for(stat in stations){
i <- i+1
output[[paste0("Out_",stat)]] <- renderText({paste0(outValues[i])})
}
这个代码后,我的表中的所有值都是706
预先感谢您的帮助,
迈克尔
检查这个帖子:http://stackoverflow.com/questions/43762513/r-shiny-bad-dependency-from- for-loop-variable-is-there-a-way-to-force-evaluatio and this discussion:https://github.com/rstudio/shiny/issues/532 – BigDataScientist
我会将它标记为重复的,而不是我认为的其他问题很难找到,你问的方式仍然带来价值。 (请参阅此处https://meta.stackoverflow.com/a/292398/3502164) – BigDataScientist
可能的重复[R对于循环变量发出不良依赖。有没有办法强制评估?](http://stackoverflow.com/questions/43762513/r-shiny-bad-dependency-from-for-loop-variable-is-there-a-way-to-force-评判的) – BigDataScientist