I have an app that is failing to deploy in shinyapps.io. The data is in the same folder the .R
files are. Locally it runs perfectly. Any help would be greatly appreciated. (fc_auxiliares.R
is a helper script with plotting functions)
Error
Error in renv_snapshot_validate_report(valid, prompt, force) :
aborting snapshot due to pre-flight validation failure
Calls: <Anonymous> ... snapshotRenvDependencies -> <Anonymous> -> renv_snapshot_validate_report
CODE
options(shiny.maxRequestSize = 200*1024^2)
# Package names
library(shinydashboard)
library(flexdashboard)
library(shinythemes)
library(shinyWidgets)
library(shinyjs)
library(thematic)
library(glue)
library(ggplot2)
library(stringr)
library(connectapi)
library(tidyverse)
library(RColorBrewer)
library(ggmap)
library(maps)
library(geosphere)
library(dplyr)
library(plotly)
library(sp)
library(viridis)
library(geojsonio)
#Load data
datos = read.csv('data_aeropuertos.csv')
datos$mes_name <- factor(datos$mes_name, levels=c('Ene', 'Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'))
datos$fecha_datetime <- factor(datos$fecha_datetime, levels=c('Lun','Mar','Mie','Jue','Vie','Sab','Dom'))
aeropuertos = read.csv('aeropuertos_detalle.csv', sep=';')
library(geojsonio)
provincias <- geojson_read("provincias.json", what = "sp")
#Helper functions 2 plot
source('fc_auxiliares.R')
ui <- fluidPage(theme = shinytheme("readable"),
titlePanel(h1("...", align="center")),
fluidRow(width=12, style = "background-color: #95c2c9; padding: 10px",
h5('...'),
p('....') ),
# #------------------------------------------------------------------------------------------------------------
fluidRow(width=12,style = "background-color: #badbe0; padding: 20px ",
# h5('..'),
p("...."),
),
# #------------------------------------------------------------------------------------------------------------
fluidRow(align='left',style="text-align: justify;",
column(width = 6,
plotlyOutput('VUELOS.X.ANIO')),
column(width = 6, h3('...'),
p(".....")
) ),
# #------------------------------------------------------------------------------------------------------------
fluidRow(style = "border: 4px double blue;",align='center',style="text-align: justify;",
column(width = 6, h3('....'),
p(".."),
),
column(width = 6,align='center',
radioGroupButtons(inputId = "radio_vuelos_mes",
label = "",
choices = c('Todos', 'Domestico', 'Internacional'),
selected = 'Todos',
status = "success"),
plotlyOutput('VUELOS.MES')
) ),
# #------------------------------------------------------------------------------------------------------------
fluidRow(align='center',style="text-align: justify;",
column(width = 8,align='center',
radioGroupButtons(inputId = "radio_vuelos_semanal",
label = "",
choices = c('Todos', '2019', '2020','2021', '2022','2023'),
selected = 'Todos',
status = "info"),
plotlyOutput('VUELOS.SEMANAL')
),
column(width = 4, align='center',style="text-align: justify;",
h3('....'),
p("....")
) ) ,
# #------------------------------------------------------------------------------------------------------------
fluidRow(style = "border: 4px double blue;",align='center',style="text-align: justify;",
column(width = 3,h3("....."),
p(".......")
),
column(width = 9, align='center',
radioGroupButtons(inputId = "radio_promDiario",
label = "",
choices = c('Todos', 'Domestico', 'Internacional'),
selected = 'Todos',
status = "success"),
plotlyOutput('PROM.DIARIO')
) ),
#------------------------------------------------------------------------------------------------------------
fluidRow(align='center',style="text-align: justify;",
column(width = 8, align='center',
radioGroupButtons(inputId = "radio_empresas",
label = "",
choices = c('Todos', '2019', '2020','2021', '2022','2023'),
selected = 'Todos',
status = "info"),
plotlyOutput('TOP.EMPRESAS')
),
column(width =4, h3('.....'),
p("....")
) ),
#------------------------------------------------------------------------------------------------------------
fluidRow(style = "border: 4px double blue;",align='center',style="text-align: justify;",
column(width = 4, h3('......'),
p("....."),
p("....")
),
column(width = 8,align='center',
radioGroupButtons(inputId = "radio_par_ori_dest",
label = "",
choices = c('Todos', '2019', '2020','2021', '2022','2023'),
selected = 'Todos',
status = "info"),
plotlyOutput('ORI.DEST'))
),
#------------------------------------------------------------------------------------------------------------
fluidRow(align='center',style="text-align: justify;",
column(width = 6, align = "center",
plotlyOutput('MAPITA')
),
column(width=6, align='center', style="text-align: justify;",
h3('......'),
p("......"),
radioGroupButtons(inputId = "rd_mapa",
label = "",
choices = c('Todos', '2019', '2020','2021', '2022','2023'),
selected = 'Todos',
status = "info"),
sliderInput("slider_mapa", "Seleccionar rango de número de vuelos anuales",
min = 0, max = 1100, value = c(300, 500))
)),
)
server <- function(input, output) {
# NRO VUELOS X ANIO
output$VUELOS.X.ANIO = renderPlotly({ despegues_x_anio(datos) })
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# NRO VUELOS X MES
anio_vuelos_x_mes = reactive({ input$radio_vuelos_mes }) #Obtengo el chbox elegido; luego accedo a el usando anio_vuelos_x_mes()
output$VUELOS.MES= renderPlotly({vuelos_mensuales(datos , anio_vuelos_x_mes() ) }) #Ejecuto la fc para plotear el grafico
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# VUELOS X DIA DE LA SEMANA
anio_vuelo_semanal = reactive ({ input$ radio_vuelos_semanal})
output$VUELOS.SEMANAL = renderPlotly({vuelos_semanales(datos , anio_vuelo_semanal() ) })
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# PROMEDIO DIARIO DE VUELOS
tipo_vuelo_promDiario = reactive ({ input$radio_promDiario})
output$PROM.DIARIO = renderPlotly({promedio_dia(datos, tipo_vuelo_promDiario() ) })
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# TOP EMRPESAS
aerol = reactive ({ input$radio_empresas})
output$TOP.EMPRESAS = renderPlotly({airlines(datos, aerol() ) })
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# PARES ORIGEN-DESTINO
rd_ori_dest = reactive ({ input$radio_par_ori_dest})
output$ORI.DEST = renderPlotly({pair_airports(datos , rd_ori_dest() ) })
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
radio_map = reactive ({ input$rd_mapa})
limInf = reactive({input$slider_mapa[1]})
limSup = reactive({input$slider_mapa[2]})
output$MAPITA = renderPlotly({plot_mapa(provincias, datos , aeropuertos , radio_map(), limInf(), limSup() ) })
}
shinyApp(ui = ui, server = server)