Closed utterances-bot closed 3 years ago
I have succeeded in step 16 and edited the app (i.e., replace the entire code by my app).Then I run the app again by clicking on the Run App button. The Shiny app appeared in my computer. I tried to published it in my internet browser by clicking on the Publish button. However.it does not work. It shows as follows. An error has occurred.The application failed to start: exited unexpectedly with code 1. I wonder what the reasons for it. Thanks inadvance.
I have succeeded in step 16 and edited the app (i.e., replace the entire code by my app).Then I run the app again by clicking on the Run App button. The Shiny app appeared in my computer. I tried to published it in my internet browser by clicking on the Publish button. However.it does not work. It shows as follows. An error has occurred.The application failed to start: exited unexpectedly with code 1. I wonder what the reasons for it. Thanks inadvance.
Can you give me the shinyapps.io link to your app? Is the code of your app available on GitHub? If yes, what is the repo? So I can try to publish it on my side to check everything is working smoothly.
Regards, Antoine
Hello,
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 ->
This is my code:
df1 <- cases2020 %>% filter(cases<500)
library(tidyverse) library(shiny) library(ggplot2)
ui <- fluidPage(
titlePanel("Old Faithful Geyser Data"),
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, server)
Hello,
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)
Define UI for application that draws a histogram
ui <- fluidPage(
Application title
titlePanel("Old Faithful Geyser Data"),
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")
}) }
Run the application
shinyApp(ui, server)
Hello,
Before trying to publish your app, is your app working locally (on your computer)?
It seems to me that you run df1 <- cases2020 %>% filter(cases<500)
but you don't import the dataset.
Regards, Antoine
Thank you for your time and response.
yes, it is working on my PC, after i click on number 2(below picture) it is published on the shiny app. but when i want to run it on shinyapp i faced with the "Error in value[3L] : could not find function "%>%"Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
Best Regards,Saeed Raeisi
On Monday, May 24, 2021, 11:30:51 AM GMT+2, Antoine Soetewey ***@***.***> wrote:
Hello,
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)
Define UI for application that draws a histogram
ui <- fluidPage(
Application title
titlePanel("Old Faithful Geyser Data"),
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")
}) }
Run the application
shinyApp(ui, server)
Hello,
Before trying to publish your app, is your app working locally (on your computer)?
It seems to me that you run df1 <- cases2020 %>% filter(cases<500) but you don't import the dataset.
Regards, Antoine
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Thank you for your time and response. yes, it is working on my PC, after i click on number 2(below picture) it is published on the shiny app. but when i want to run it on shinyapp i faced with the "Error in value[3L] : could not find function "%>%"Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
Execution halted"
The error could not find function "%>%"
means that the dplyr
package is not correctly installed or loaded. Can you try again by fixing this issue first?
It did not work.can I share my screen via zoom?
I use the df1 from R script. and didnt use the file directly to the app.R. may the error be because of this?
Best Regards,Saeed Raeisi
On Monday, May 24, 2021, 12:00:44 PM GMT+2, Antoine Soetewey ***@***.***> wrote:
Thank you for your time and response. yes, it is working on my PC, after i click on number 2(below picture) it is published on the shiny app. but when i want to run it on shinyapp i faced with the "Error in value[3L] : could not find function "%>%"Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted" Best Regards,Saeed Raeisi On Monday, May 24, 2021, 11:30:51 AM GMT+2, Antoine Soetewey @.***> wrote: Hello, 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) Define UI for application that draws a histogram ui <- fluidPage( Application title titlePanel("Old Faithful Geyser Data"), 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") }) } Run the application shinyApp(ui, server) Hello, Before trying to publish your app, is your app working locally (on your computer)? It seems to me that you run df1 <- cases2020 %>% filter(cases<500) but you don't import the dataset. Regards, Antoine — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
The error could not find function "%>%" means that the dplyr package is not correctly installed or loaded. Can you try again by fixing this issue first?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
It did not work.can I share my screen via zoom?
I use the df1 from R script. and didnt use the file directly to the app.R. may the error be because of this?
Best Regards,Saeed Raeisi
Yes. You refer to a dataset in your app that is not available outside of your environment. So your app cannot use that dataset.
So you must publish your data as well. The easiest way is to host the dataset online as a csv file and then import it via the url (at the beginning of your code).
Hope this helps.
Regards, Antoine
Hi, this is a great article, thank you for sharing it. I have two questions please.
Hi, this is a great article, thank you for sharing it. I have two questions please.
- I developed a shiny app in my local computer that queries and source the data from databases I created and saved in my PC. How can I still use and access the data in my database if I publish the app?
- My shiny app is quite big so I organized it over multiple files. Meaning, the main file has the code that defines all the pages and tabs, but the code where I developed each page is in separate R files. How can I deploy it in this case ? Thank you, Andrea
Dear Andrea,
Hope this helps.
Regards, Antoine
How to publish a Shiny app: example with shinyapps.io - Stats and R
See a step-by-step guide (with screenshots) on how to deploy and publish online a Shiny app using shinyapps.io
https://statsandr.com/blog/how-to-publish-shiny-app-example-with-shinyapps-io/