【发布时间】:2018-09-26 03:57:57
【问题描述】:
我目前正在尝试将使用 dygraphs 包的 R Shiny 应用程序部署到 shinyapps.io。我的应用程序在本地运行良好,但是当我尝试部署它时说找不到网页 - “HTTP 500 内部服务器错误”。我的用户界面代码是:
shinyUI(fluidPage(
titlePanel("MyApp"),
fluidRow(
column(12,
p("Info Text")
,dygraphOutput("plot")
)
)
))
而服务器代码是:
shinyServer(function(input, output) {
library(shiny)
library(dygraphs)
output$plot<- renderDygraph({
data <- read.csv("data.csv", header=TRUE, sep =",",na.strings="-")
dygraph(data, main = "Plot") %>%
dyLegend(width = 170 ,
labelsSeparateLines = TRUE ,
show = "always") %>%
dyOptions(stackedGraph = FALSE)
当我从 UI 代码中删除 dygraphOutput 函数时,应用程序部署成功。有没有人遇到过类似的 dygraphs 问题?
【问题讨论】:
-
我认为您的
csv可能有问题,您可以dput(data)并在此处发布输出 -
结构(列表(年 = 2009:2015, A = c(0.01, 0.01, 0.01, 0.01, 0.01, 0.02, 0.03), B = c(0.01, 0.01, 0.01, 0.01, 0.01) , 0.01, 0.01), C = c(0.06, 0.06, 0.08, 0.09, 0.11, 0.12, 0.14)), .Names = c("年份", "A", "B", "C"), class= "data.frame", row.names = c(NA, -7L))
标签: r shiny shiny-server dygraphs r-dygraphs