![](/img/trans.png)
[英]how to call a shiny module in another shiny module (reactive function from one module to the other)
[英]how to call variable defined in reactive function of shiny in other reactive function
我在Shiny中有以下server.r
文件
enterdata <- reactive({
a <- "Hello"
b <- data.frame()
})
我將如何在其他反應函數中調用變量a
。 我有數據幀在weell enterdata
,但我只想要a
在其他函數調用
getdata <- reactive({
sum <- paste(enterdata()$a,"Neil")
})
以上正確的方法嗎?
您應該將reactive
視為function
。 因此,如果您想返回更多值,則將一個值放在列表中,例如:
enterdata <- reactive({
a <- "Hello"
b <- data.frame()
list(a = a, b = b)
})
以后您可以將其視為列表:
getdata <- reactive({
sum <- paste(enterdata()$a,"Neil")
})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.