Error in func(fname, ...) : app.R did not return a shiny.appobj object

I want to publishing a data on shinaapp, i faced with the below error on R,

"Error in func(fname, ...) : app.R did not return a shiny.appobj object"
And in the shinyapp i faced with
"Error in value[3L] : could not find function "%>%"
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
Execution halted"

This is my code:

df1 <- cases2020 %>% filter(cases<500)

library(tidyverse)

library(shiny)

library(ggplot2)

ui <- fluidPage(

 

  titlePanel("The Number of Cases in the Norway"),

 

  sidebarLayout(

    sidebarPanel(

      sliderInput("bins",

                  "Number of bins:",

                  min = 1,

                  max = 50,

                  value = 30)

    ),

   

    

    mainPanel(

      plotOutput("distPlot") ,

      plotOutput ("fylke")

    )

  )

)

 

server <- function(input, output) {

 

  output$distPlot <- renderPlot({

   

    Cases_Frequently    <-df1$cases

    bins <- seq(min(Cases_Frequently), max(Cases_Frequently), length.out = input$bins + 1)

    hist(Cases_Frequently, breaks = bins, col = 'blue', border = 'white', xlab = "Cases")

  })

 

  output$fylke <- renderPlot({

   

    y<-Newcases2020_sum$month

   

    z<-Newcases2020_sum$sumcases

   

    plot(x=y, y=z, xlab = "Month", ylab = "Cases")   

  })

}

 

shinyApp(ui = ui, server = server)

You have to load the packages before using their functions, move your library calls to the beginning of your script.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.