Tar*_*eva 8 r shiny shiny-server
我正在尝试在Shiny.io上传一个闪亮的应用程序.该应用程序已部署,当尝试链接时,应用程序将通过抛出与服务器断开连接的错误而崩溃.当我检查仪表板的日志时,它在服务器中显示错误:找不到功能"服务器".
我无法找到解决方案.有关相同文档和文章显示使用的软件包可能是错误的原因之一,但我无法找到兼容与否的软件包列表.
这些是我的应用程序中使用的包/库列表,
提前致谢!!
UPDATE
下面是可重现的ui.R和server.R脚本.经过调试,我发现在部署时这部分代码是错误的.
ui.R
library(shiny)
library(shinyBS)
library(shinycssloaders)
options(shiny.trace=TRUE)
shinyUI(pageWithSidebar(
fluidRow(
column(width = 4,height = 4,img(src='image.png', align = "left", height =
50, width = 200)),
column(8,titlePanel("Analysis"))
),
sidebarPanel(
br(),
fileInput("file1", label = (" Data "),multiple = F),
fluidRow(
column(12,align ="center", actionButton("button", "Analyze",style =
"background-color : skyblue", icon = icon("stats", lib =
"glyphicon"),width = 250 )))
),
mainPanel(
bsAlert("alert"),
br(),
fluidRow(
tabsetPanel(
tabPanel("Table",icon =
icon("table"),withSpinner(dataTableOutput('table'), type =
getOption("spinner.type", default = 8) ))
)
)
)
))
Run Code Online (Sandbox Code Playgroud)
server.R
library(shiny)
library(shiny)
library(earth)
library(ggplot2)
library(plot3D)
library(visreg)
library(rgl)
library(zoo)
library(Hmisc)
library(dplyr)
library(gridExtra)
options(shiny.maxRequestSize=30*1024^2)
options(shiny.trace=TRUE)
if (interactive()){
shinyServer(function(input, output,session) {
dataframe <- reactive( {
### Create a data frame reading data file to be used by other
functions..
inFile <- input$file1
data1 <- read.csv(inFile$datapath, header = TRUE)
})
table1<- eventReactive(input$button, dataframe())
output$table <- renderDataTable({table1()})
})
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
最后我能够调试代码并找到错误的解决方案。
从Server.R
删除语句并从 中if (interactive())
删除参数。 session
shinyServer(function(input,output,session))
因此部署没有任何错误。
替换以下 server.R 脚本,它应该可以正常工作。
library(shiny)
library(shiny)
library(earth)
library(ggplot2)
library(plot3D)
library(visreg)
library(rgl)
library(zoo)
library(Hmisc)
library(dplyr)
library(gridExtra)
options(shiny.maxRequestSize=30*1024^2)
options(shiny.trace=TRUE)
shinyServer(function(input, output) {
dataframe <- reactive( {
### Create a data frame reading data file to be used by other functions..
inFile <- input$file1
data1 <- read.csv(inFile$datapath, header = TRUE)
})
table1<- eventReactive(input$button, dataframe())
output$table <- renderDataTable({table1()})
})
Run Code Online (Sandbox Code Playgroud)