1

I am new to Shiny R and was successful in creating my first app (YAY!)! I then tried to deploy it (or publish it) and got the following error message on the web page it opened (it was working correctly within R studio and seemed to deploy ok). I checked only the app.R box when I went to publish it.

Error: Cannot open the connection.

I have had a look at other answers on here and elsewhere but I either have used the solutions and they haven't worked or haven't understood the answers (I am pretty new to R and Shiny R). I am at my wits end and really want to get this up and running as I love what Shiny is capable of. Can anyone help?? The code I used is;

require(shiny)
meanweights <- read.csv("meanweights.csv")

ui <- fluidPage(
  selectInput(inputId = "statesel",
              label="Choose a state",
              choices = sort(unique(meanweights$state)),
              selected = "VIC",
              multiple = FALSE),
  plotOutput("lineplot")
)


server <- function(input, output) {
  output$lineplot <- renderPlot({
    read.csv("meanweights.csv") %>% 
      filter(state == input$statesel) %>% 
      ggplot(aes(day, mean_weight, color=property_type))+
      geom_line()+theme_bw(base_size = 14)
  })
}

shinyApp(ui = ui, server = server)

Thanks for you time.

datagirl
  • 11
  • 2
  • Have a look here. http://stackoverflow.com/questions/27793616/how-to-deploy-shiny-app-that-uses-local-data, make sure you have done all those things and then if you still have the same error, edit your post and mention where your data was put, etc... – Mike Wise Jan 12 '17 at 09:29
  • a couple of slightly unrelated comments: 1) use `library` instead of `require` here, 2) make sure you include a `library("dplyr")` and 3) `read.csv("meanweights.csv") %>% ` should be replaced with `meanweights %>% ` – mlegge Jan 12 '17 at 19:33

0 Answers0