我在centos 6上使用了闪亮的服务器,它与我的大多数应用程序都能很好地工作,但是当我将其与rCharts一起使用时出现了问题(ggplot2可以)。chrome给我显示了一条消息“无法加载资源:服务器响应状态为500(内部服务器错误)”,但是我可以在本地Windows7系统上运行相同的代码。并且没有关于它的错误日志。它出什么问题了。如果有朋友知道如何处理,请告诉我,谢谢。
代码是:
require(rCharts)
shinyServer(function(input, output) {
output$myChart <- renderChart({
names(iris) = gsub("\\.", "", names(iris))
p1 <- rPlot(input$x, input$y, data = iris, color = "Species",
facet = "Species", type = 'point')
p1$addParams(dom = 'myChart')
return(p1)
})
})
#ui.R
require(rCharts)
shinyUI(pageWithSidebar(
headerPanel("rCharts: Interactive Charts from R using polychart.js"),
sidebarPanel(
selectInput(inputId = "x",
label = "Choose X",
choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'),
selected = "SepalLength"),
selectInput(inputId = "y",
label = "Choose Y",
choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'),
selected = "SepalWidth")
),
mainPanel(
showOutput("myChart", "polycharts")
)
))
是的!我终于检查了一下,因为我还没有将应用程序的模式(ui.R和server.R)更改为可读模式!在ui.R的chmod 755和server.R之后,它运行良好。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句