部署后,闪亮的应用程序变为灰色(与服务器断开连接),在本地运行正常

时间:2016-05-06 15:38:30

标签: r shiny

我部署了一个应用程序 这是我的申请:https://jleandroj.shinyapps.io/indicators/ 这是存储库:https://github.com/jleandroj/indicators

ui.R

library(shiny)
library(raster)
library(sp)
shinyUI(navbarPage("Global indicators",
tabPanel("Main indicators",
fluidPage(  
  imageOutput("distPlot",width = "100%",height = "400px"),
    hr(),
    fluidRow(
    column(9,
      h4("Ranking"),     
      dataTableOutput('table')
    ),  
    column(3,
    br(),
    checkboxGroupInput("checkGroup", label = h3("Social and economic   indicators"), 
                choices = list('Breast cancer per 100th' = 'breastcancerper100th', 'HIV rate' = 'hivrate',
                                                                   'Suicide per 100th' = 'suicideper100th',
                                                                   'Oil per person' = 'oilperperson',
                                                                   'Alc consumption' = 'alcconsumption',
                                                                   'Polity score' = 'polityscore',
                                                                   'Armed forces rate' = 'armedforcesrate',
                                                                   'CO2 emissions' = 'co2emissions',
                                                                   'Income per person' = 'incomeperperson',
                                                                   'Female employ rate' = 'femaleemployrate',
                                                                   'Employ rate' = 'employrate',
                                                                   'Internet use rate' = 'internetuserate',
                                                                   'Electric per person' = 'relectricperperson'),selected = 'breastcancerper100th')
              )))
    ),
    tabPanel("About indicators",
             includeMarkdown("read.Rmd")
             )
))

server.R

library(shiny)
library(raster)
polygons <- shapefile("data/TM_WORLD_BORDERS_SIMPL-0.3.shp")
gap<-read.csv("data/gapminder.csv",header = TRUE)
names(gap)[1]<-paste("NAME")

shinyServer(function(input, output) {

output$distPlot <- renderPlot({

polygons1 <- merge(polygons,gap, by="NAME")

spplot(polygons1,input$checkGroup, main=paste(input$checkGroup), lwd=.8, col="black")

})

output$table <-  renderDataTable({ 

  gap2<-subset(gap, select = c("NAME",input$checkGroup));

  gap2<-gap2[with(gap2, order(-gap2[,2])),];

  gap2
})
})

当我部署时,我得到一个带有消息的灰色屏幕&#34;与服务器断开连接&#34;

我在设置中修改了很多选项,我添加了很多库,我尝试了所有但是我得到了同样的信息。

感谢您的帮助。

0 个答案:

没有答案