【发布时间】:2020-08-01 02:01:19
【问题描述】:
有没有办法列出闪亮应用程序的对象(数据帧、函数、args(函数)、输入、输出。在下面的应用程序中,有 actionButton()、numericInput() 等输入和输出renderText()。有没有办法将这些与 ID 一起列出(例如,动作按钮有“goButton”)等等。
此外,这里声明了一个名为“asd”的函数,带有参数 (3,4)。我们也可以列出这些信息吗?请指导
ui.R
source("fun.R")
pageWithSidebar(
headerPanel("actionButton test"),
sidebarPanel(
numericInput("n", "N:", min = 0, max = 100, value = 50),
br(),
actionButton("goButton", "Go!"),
p("Click the button to update the value displayed in the main panel.")
),
mainPanel(
verbatimTextOutput("nText")
)
)
服务器.R
function(input, output) {
# builds a reactive expression that only invalidates
# when the value of input$goButton becomes out of date
# (i.e., when the button is pressed)
ntext <- eventReactive(input$goButton, {
input$n
})
output$nText <- renderText({
asd(3,4)
})
}
fun.R
asd <- function(a,b)
{
c <- a + b
return(c)
}
【问题讨论】:
标签: shiny