【发布时间】:2013-12-09 15:11:09
【问题描述】:
我正在开发一个带有 2 个表格、1 个图表和一个条件答案的 Shiny 应用程序。
我想直接在 Shiny 中向表中添加一行并更新结果。
例如,在具有 id、2 个日期和 2 个多项选择题的表格中。我有 3 个观察结果,我希望用户能够添加 n others 观察结果,这应该会导致其他表格和图表使用这些新观察结果进行更新。
有可能吗?如果是,你如何做到这一点?
谢谢你,原谅我的英语不好。
这里是我的 Shiny 应用程序的链接 http://www.hostingpics.net/viewer.php?id=459723Shiny.png
这里是工作的代码:
https://gist.github.com/wolf6541/7874968
我已经为我的问题尝试过这个:
**Ui.r**
#Titre
h3("Ajout d'un nouveau patient"),
#Date inclusion
dateInput("date_inclu", "Date de l'inclusion", value = ,language = "fr"),
#Date reponse
dateInput("date_rep", "Date de reponse", value = ,language = "fr"),
#Dose
textInput("dose", "Dose administree", ),
#Reponse
textInput("tox", "Reponse toxicite", ),
updateData()
**Server.R**
identifiant =length(data_time$identifiant)
dose =reactive(input$dose)
date_inclusion =reactive(input$date_inclu)
date_reponse =reactive(input$date_rep)
reponse =reactive(input$tox)
nouveau_pat = cbind(identifiant, dose, date_inclusion, date_reponse, reponse)
nouveau_pat = as.data.frame(nouveau_pat)
data_time = rbind(data_time,nouveau_pat)
但这不起作用
【问题讨论】:
-
添加您迄今为止尝试过的内容。如果 Stackoverflow 社区可以查看您的尝试,他们将能够为您提供帮助。
-
感谢您的帮助,我刚刚更新了我的帖子
标签: r interface rows rstudio shiny