Oh ok, no, I tried taking out the accents but I get the same error.
Of course, I leave here my code. Thank you very much!
library("shiny" )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
#library("shinyWidgets" )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
library("shinydashboard")#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
library("leaflet" )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
library("lubridate" )#, lib.loc = "/../../../../data/R-libs/x86_64-pc-linux-gnu-library/3.4/")
# Set up the UI
ui <- dashboardPage(
dashboardHeader(title = "Panel QPE - Control de ejecución", titleWidth = 350),
dashboardSidebar(
sidebarMenu(
sliderInput("DatesMerge", label = "Seleccion de fecha del control:",
min = as.Date(Sys.Date() - 30, "%Y-%m-%d"),
max = as.Date(Sys.Date() , "%Y-%m-%d"),
value = as.Date(Sys.Date()),
timeFormat = "%Y-%m-%d",
width = 250, dragRange = FALSE),
menuItem("QPE Merge", tabName = "maps", icon = icon("globe"),
menuSubItem("Control archivos de entrada IMERG" , tabName = "c_files_1", icon = icon("table")),
menuSubItem("Control archivos de entrada OBS" , tabName = "c_files_2", icon = icon("table")),
menuSubItem("Estaciones utilizadas y BIAS interpolado v0.1", tabName = "c_algor_1" , icon = icon("map")),
menuSubItem("IMERG-ER y SQPE-OBS-v0.1" , tabName = "c_algor_2" , icon = icon("map")),
menuSubItem("Estaciones utilizadas y BIAS interpolado v0.2", tabName = "c_algor_3" , icon = icon("map")),
menuSubItem("IMERG-ER y SQPE-OBS-v0.2" , tabName = "c_algor_4" , icon = icon("map"), selected = TRUE)),
menuItem("Aplicaciones hidrologicas", tabName = "maps", icon = icon("globe"),
menuSubItem("Garruchos" , tabName = "c_algor_5", icon = icon("table")),
menuSubItem("Paso de los Libres" , tabName = "c_algor_6", icon = icon("table")))
), width = 320
),
dashboardBody(tabItems(
tabItem(tabName = "c_files_1", fluidRow(box(title = "Seccion del Panel del Control: archivos de entrada IMERG-ER",
collapsible = TRUE, width = "100%", height = "100%",
htmlOutput("data_files_1")))),
tabItem(tabName = "c_files_2", fluidRow(box(title = "Seccion del Panel del Control: archivos de entrada OBS",
collapsible = TRUE, width = "100%", height = "100%",
htmlOutput("data_files_2")))),
tabItem(tabName = "c_algor_1" , fluidRow(box(title = "Seccion del Panel del Control: estaciones utilizadas y BIAS interpolado",
collapsible = TRUE, width = "100%",
imageOutput("data_algor_1")))),
tabItem(tabName = "c_algor_2" , fluidRow(box(title = "Seccion del Panel del Control: mapas IMERG-ER y SQPE-OBS-v0.1",
collapsible = TRUE, width = "100%",
imageOutput("data_algor_2")))),
tabItem(tabName = "c_algor_3" , fluidRow(box(title = "Seccion del Panel del Control: estaciones utilizadas y BIAS interpolado",
collapsible = TRUE, width = "100%",
imageOutput("data_algor_3")))),
tabItem(tabName = "c_algor_4" , fluidRow(box(title = "Seccion del Panel del Control: mapas IMERG-ER y SQPE-OBS-v0.2",
collapsible = TRUE, width = "100%",
imageOutput("data_algor_4")))),
tabItem(tabName = "c_algor_5" , fluidRow(box(title = "Simulaciones de caudal - Rio Uruguay (Garruchos)",
collapsible = TRUE, width = "100%",
imageOutput("data_algor_5")))),
tabItem(tabName = "c_algor_6" , fluidRow(box(title = "Simulaciones de caudal - Rio Uruguay (Paso de los Libres)",
collapsible = TRUE, width = "100%",
imageOutput("data_algor_6"))))
)
)
)
# Define a server for the Shiny app
server <- function (input, output)
{
rv.listado <- reactive({
imerg <- as.character(seq(from = as.POSIXct(paste0(input$DatesMerge - 1, " 12:00:00"), tz = "UTC"),
to = as.POSIXct(paste0(input$DatesMerge, " 11:30:00"), tz = "UTC"),
by = "30 min"))
listado.dia1 <- list.files(path = paste0("/ms-36/ESTPP/1_HourlyData/imerg_er/", year(input$DatesMerge), "/"),
pattern = paste0("3B-HHR-E.MS.MRG.3IMERG.", format(input$DatesMerge - 1, "%Y%m%d"), "-S",
"\\d{6}\\-E", "\\d{6}\\", ".", "\\d{4}\\", ".V06B.RT-H5"))
listado.dia2 <- list.files(path = paste0("/ms-36/ESTPP/1_HourlyData/imerg_er/", year(input$DatesMerge), "/"),
pattern = paste0("3B-HHR-E.MS.MRG.3IMERG.", format(input$DatesMerge, "%Y%m%d"), "-S",
"\\d{6}\\-E", "\\d{6}\\", ".", "\\d{4}\\", ".V06B.RT-H5"))
listado <- c(listado.dia1, listado.dia2)
listado.reducido <- as.POSIXlt(substr(listado, start = 24, stop = 39), format = "%Y%m%d-S%H%M%S")
listado.reducido <- as.character(listado.reducido)
paste0(imerg, " ", imerg %in% listado.reducido)
})
output$data_files_1 <- renderText({
paste0("<p>", rv.listado(), "</p>")
})
rv.listado.obs <- reactive({
if (file.exists(paste0("./estaciones/precip24h_emas+conv_", input$DatesMerge - 3, ".txt")) == TRUE)
{out.1 <- paste0("precip24h_emas+conv_", input$DatesMerge - 3, ".txt existe")} else
{out.1 <- paste0("precip24h_emas+conv_", input$DatesMerge - 3, ".txt FALTANTE")}
if (file.exists(paste0("./estaciones/precip24h_emas+conv_", input$DatesMerge - 2, ".txt")) == TRUE)
{out.2 <- paste0("precip24h_emas+conv_", input$DatesMerge - 2, ".txt existe")} else
{out.2 <- paste0("precip24h_emas+conv_", input$DatesMerge - 2, ".txt FALTANTE")}
if (file.exists(paste0("./estaciones/precip24h_emas+conv_", input$DatesMerge - 1, ".txt")) == TRUE)
{out.3 <- paste0("precip24h_emas+conv_", input$DatesMerge - 1, ".txt existe")} else
{out.3 <- paste0("precip24h_emas+conv_", input$DatesMerge - 1, ".txt FALTANTE")}
rbind(out.1, out.2, out.3)
})
output$data_files_2 <- renderText({
paste0("<p>", rv.listado.obs(), "</p>")
})
# v0.1 ------------------------------------------------------------------------
rv.imagenes <- reactive({
listado.imagenes.1 <- list.files(path = "./ajuste/",
pattern = paste0("Obs_", format(input$DatesMerge - 1, "%Y%m%d"), "_D\\d{3}\\_E\\d{1}\\^?[,.]?\\d{1}\\", ".png"))
listado.imagenes.2 <- list.files(path = "./ajuste/",
pattern = paste0("Ajuste_", format(input$DatesMerge - 1, "%Y%m%d"), "_D\\d{3}\\_E\\d{1}\\^?[,.]?\\d{1}\\", ".png"))
listado.imagenes <- list(a = listado.imagenes.1[1], b = listado.imagenes.2[1])
listado.imagenes
})
output$data_algor_1 <- renderImage({
#out.imagenes <- rv.imagenes()
filename <- normalizePath(file.path('./ajuste/', paste(rv.imagenes()$a)))
# Return a list containing the filename
list(src = filename)
}, deleteFile = FALSE)
output$data_algor_2 <- renderImage({
#out.imagenes <- rv.imagenes()
filename <- normalizePath(file.path('./ajuste/', paste(rv.imagenes()$b)))
# Return a list containing the filename
list(src = filename)
}, deleteFile = FALSE)
# -----------------------------------------------------------------------------
# v0.2 ------------------------------------------------------------------------
rv.imagenes.0.2 <- reactive({
listado.imagenes.1 <- list.files(path = "./ajuste_v0.2/",
pattern = paste0("Obs_", format(input$DatesMerge - 1, "%Y%m%d"), ".png"))
listado.imagenes.2 <- list.files(path = "./ajuste_v0.2/",
pattern = paste0("Ajuste_", format(input$DatesMerge - 1, "%Y%m%d"), ".png"))
listado.imagenes <- list(a = listado.imagenes.1, b = listado.imagenes.2)
listado.imagenes
})
output$data_algor_3 <- renderImage({
#out.imagenes <- rv.imagenes()
filename <- normalizePath(file.path('./ajuste_v0.2/', paste(rv.imagenes.0.2()$a)))
# Return a list containing the filename
list(src = filename)
}, deleteFile = FALSE)
output$data_algor_4 <- renderImage({
#out.imagenes <- rv.imagenes()
filename <- normalizePath(file.path('./ajuste_v0.2/', paste(rv.imagenes.0.2()$b)))
# Return a list containing the filename
list(src = filename)
}, deleteFile = FALSE)
# -----------------------------------------------------------------------------
rv.imagenes.hidro <- reactive({
listado.imagenes.1 <- list.files(path = "./app_hidrologicas/",
pattern = paste0(format(input$DatesMerge, "%Y-%m-%d"), "_GARRU.png"))
listado.imagenes.2 <- list.files(path = "./app_hidrologicas/",
pattern = paste0(format(input$DatesMerge, "%Y-%m-%d"), "_PASOL.png"))
listado.imagenes <- list(a = listado.imagenes.1, b = listado.imagenes.2)
listado.imagenes
})
output$data_algor_5 <- renderImage({
filename <- normalizePath(file.path('./app_hidrologicas/', paste(rv.imagenes.hidro()$a)))
# Return a list containing the filename
list(src = c(filename), width = 800, height = 600)
}, deleteFile = FALSE)
output$data_algor_6 <- renderImage({
filename <- normalizePath(file.path('./app_hidrologicas/', paste(rv.imagenes.hidro()$b)))
# Return a list containing the filename
list(src = c(filename), width = 800, height = 600)
}, deleteFile = FALSE)
}
shinyApp(ui = ui, server = server)