java调用shiny_使用Shiny App(R)从文本输入中连续输出新的数据帧

我试图通过添加一个新行然后使用闪亮的输入和输出渲染最新更新的表来连续填充数据框 . 用户在文本字段中键入“推荐”,并且每次单击操作按钮时都需要将其添加到数据框中 . 用户应该能够根据需要添加任意数量的行 . 这是我的代码:

server.R

# here I am using observe and isolate to ensure the action button only applies to the textfield in question

values

observe({

if(input$actionButton > 0) {

values$textInput

}

})

# here is the output to render the table. Note that there is a function called "addRec" which brings in the current data frame with existing recommendations and the most recently typed recommendation from the text input

output$table

p

p

})

我的ui.R像往常一样显示了这张 table

htmlOutput("table")

这是我用于向数据框添加新行的函数 . 它接收当前存在的数据帧,使用新的textinput和其他一些值添加一行,使用绑定创建新的数据帧,然后返回新形成的帧 .

addRec

newRecommendation

lFinal

newFrame

return(newFrame)

}

你可以在我的server.R文件中看到输出$ table递归地将最新的表添加到函数中 . 但我得到的只是返回没有新行的同一个表 . 当用户在文本字段中输入推荐时,它只是实时更新最后一行 . 每次新推荐时我都需要输出一个新的数据帧 .

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值