编辑
已解决:他们现在已修复的闪亮服务器存在问题
我有一个奇怪的问题,我准确地复制了用户指南,示例应用程序无法为我正确部署。该应用程序在本地按预期工作,但是当我部署到shinyapps.io该应用程序时仅加载 ui,即使这也是错误的。
用户界面:
## ui.R
library(shiny)
shinyUI(fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
))
服务器
## server.R
library(shiny)
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
})
当我在本地运行时,我得到了预期: 图片
但是,当我部署时,我得到: 图像(注意输入更改为文本输入)
将不胜感激任何帮助