Hi there. I am trying to run my first shinyapp.io aplication, but I cannot do it. Mi shinyApp is working on my console, but can´t send it to the web. It says "It doesn´t find the dataframe. I have read the problema people have in the community with that, but I can´t find the solution. I hope someone had the same problem and can help me. Thank you before you try. Rubén.
If it´s worth it, here is my code:
#CODE:
setwd("C:/Users/34617/Desktop/cor13-04-2020")
coronavirus <- read.csv("cor13-04-2020/covid_19_data.csv")
library(dplyr)
coronavirus_resume <- select(coronavirus, ObservationDate, Country.Region, Confirmed, Deaths, Recovered)
coronavirus_total <- coronavirus_resume %>% group_by(Country.Region, ObservationDate) %>% summarise(Confirmed = sum(Confirmed),Deaths = sum(Deaths),Recovered = sum(Recovered))
View(coronavirus_total)
r shiny
#Ui
library(shiny)
ui <- (fluidPage(
titlePanel("Introduction table of COVID-19"),
sidebarLayout(
sidebarPanel(
selectInput("instate", "select a country", choices = coronavirus_total$Country.Region)
),
mainPanel(
tabsetPanel(type="tab",
tabPanel("Summary", verbatimTextOutput("summary")),
tabPanel("Structure", verbatimTextOutput("str")),
tabPanel("Data", dataTableOutput("tab")))
)
)
)
)
server
library(DT)
server <- (shinyServer(function(input,output){
output$summary <- renderPrint({
coronavirus_total %>%
filter(.,Country.Region %in% input$instate
) %>% summary()
})
output$str <- renderPrint({
coronavirus_total %>%
filter(.,Country.Region %in% input$instate
) %>% str()
})
output$tab <- renderDataTable((
coronavirus_total %>%
filter(.,Country.Region %in% input$instate)
))
}))
shinyApp(ui = ui, server = server)