shinyapp.io "An error has occurred. Check your logs or contact the app author for clarification"

Hi there! I am running shinyapp.io to show my aplications on the web. I already have succesfully uploaded 2 apps to the platform, now I am with the third, following the same steps as before, but when I run it, it doesn´t show me any data, it appears that problem.

I am not using setw and I am setting the main file in the app window like this:

image

Also the App is working locally as It has to do. If anyone can help me I Will apreciate it! Thank you .

Rubén.

Recommend you look at the logs to identify runtime error on your hosted app.
in your console...
pass the parameter for the name of your app to appName

rsconnect::showLogs(appName="name_of_app",streaming=TRUE)

streaming means it should report any log as its being written, so you could go to browser and start your app. and look back in your console for what has happened

Hi nirgrahamuk, I did what you told me, and I am getting that function "select" and "%>$" are not found. I don´t know why, I have the dplyr library, I don´t know what else to do...


I show you my code, maybe you can help me please…

r shiny

library(shiny)
library(ggplot2)
library(readr)
library(dplyr)
library(DT)

coronavirus_total_20 <- read.csv("coronavirus_total_20.csv")
#Ui
library(shiny)

ui <- fluidPage(
titlePanel(title = h4("Ranking of COVID-19 Rates", align = "center")),
sidebarLayout(
sidebarPanel(
selectInput("data", "1- Select the data you want to know:", choices = c("Rate_confirmed_per_habitant", "Rate_deaths_per_habitant"), selected = "Rate_confirmed_per_habitant" ),
br(),
sliderInput("number", "2- Select the number of countries you want to rank:", min=5, max=20, value=10),
),

    mainPanel(
        
        tabsetPanel(type="tab",
                    tabPanel("Summary", verbatimTextOutput("summary")),
                    tabPanel("Structure", verbatimTextOutput("str")),
                    tabPanel("Data", tableOutput("tab")),
                    tabPanel("Plot", textOutput("obs"), plotOutput("myplot")))                        
    )        
)    

)

server

server <- function(input, output) {
output$obs <- renderText(
paste("You are representing the first", input$number, "countries classified by ", input$data )
)

output$summary <- renderPrint({
    colm <- req(input$data)
    select(coronavirus_total_20, Country.Region, !!sym(colm)
    ) %>% summary()
})  
output$str <- renderPrint({
    colm <- req(input$data)
    select(coronavirus_total_20, Country.Region,!!sym(colm)
    ) %>% str()
})

output$tab <- renderTable({
    colm <- sym(req(input$data))
    df <- select(coronavirus_total_20,Country.Region,!!sym(colm))
    df1 <- df %>% arrange(-!!colm)
    
})

output$myplot <- renderPlot({
    dat <- sym(req(input$data))
    df2 <- select(coronavirus_total_20,Country.Region,!!dat)
    df3 <- df2 %>% arrange(-!!dat) 
    cor <- filter(df3,row_number() <= req(input$number))
    
    graph <- ggplot(cor, aes(x = reorder(Country.Region, -!!dat), y = !!dat, fill=!!dat)) +
        geom_col() 
    
    graph  + geom_text( aes( label = (!!dat)), vjust = -0.3, size=4) + labs(x= "Countries") + theme(axis.text.x = element_text(angle = 90, hjust = 1))
})

}

shinyApp(ui, server)

I got to do it with your help! Thank you very much!!

thanks, was it a straightforward solution in the end ?

Yes! Well, I had to investigate a bit, but so Good. Thanks!

1 Like

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