【发布时间】:2021-08-02 21:05:37
【问题描述】:
我编写了一个将 PDF 表转换为 CSV 的 R 脚本 (MAIN.R)。当我将 MAIN.R 作为单个文件运行时,它运行良好。我已经试过很多次了。
目前,我正在开发一个使用“MAIN.R”作为源并以 pdf 文件作为输入的 R 闪亮应用程序。当我按下提交按钮时,输出应该出现在主面板中。不幸的是,提交按钮没有按预期工作。
由于我是 Shiny 的新手,有人可以帮助我吗?
UI.R
shinyUI(fluidPage(
titlePanel("DATASET CONVERSION"),
sidebarLayout(
fileInput("filein", label = h2("Select a file to convert.")),
submitButton("Submit")
),
mainPanel(
tableOutput("Dataset")
)
)
)
Server.R
source("MAIN.R")
shinyServer(function(input, output) {
outputdf <- reactive({ input$filein
})
output$Dataset <- renderTable({
outputdf()
})
})
【问题讨论】:
-
您能否包含
MAIN.R文件来制作MRE?谢谢!outputdf()是如何定义的?我想在采购功能时出了点问题。另请参阅submitButton是 deprecated -
@starja,它没有弃用,它“通常不鼓励使用更通用的
actionButton()”(尽管情绪仍然)。
标签: r user-interface shiny shiny-server shinyapps