Commit 5a67d0fc authored by Aqeel Padaria's avatar Aqeel Padaria

show confidence interval values in forecast table

parent 519467a8
......@@ -24,7 +24,7 @@ forecastUI <- function(directory = ".", run = TRUE)
.shiny-output-error { visibility: hidden; }
.shiny-output-error:before {
visibility: visible;
content: 'Error: Invalid combination. Please recheck your selections.'; }
content: ' '; }
}
"
......@@ -134,8 +134,11 @@ server = shinyServer(
})
shinyjs::hide("demo-switch")
shinyjs::disable("uploadbox")
}else{
options(spinner.size=1)
if(user$fullname=="") user$fullname=user$displayName
......@@ -162,6 +165,7 @@ server = shinyServer(
files <- dir(directory)
files <- files[grepl("TSFO", files)]
files <- files[!grepl("[$]", files)]
files <- gsub("\\.xlsx", "", files)
files <- gsub("TSFO - ", "", files)
......@@ -176,6 +180,14 @@ server = shinyServer(
datasetName
})
output$errorOptions <- renderUI({
selectInput("error",
label = "Choose accuracy error metric",
choices = list("Standard MAPE","Adjusted MAPE","Weighted MAPE"),
selected = "Adjusted MAPE")
})
output$dataOptions <- renderUI({
file <- datasetSelect()
......@@ -287,6 +299,36 @@ server = shinyServer(
timeval
})
# getDecomp <- reactive({
# datasetName <- datasetSelect()
#
# modname <- dataSelect()
#
# original <- read.xlsx(datasetName, sheet = paste("d", modname, sep = "_"), colNames = TRUE, , check.names = FALSE)
#
# original$date <- as.Date(original$date, origin = "1899-12-30")
#
# original <- data.frame(valdate = original$date, value = original[,input$metric])
#
# type <- getTimeVal()
#
# freq <- 1
#
# l <- nrow(original)
#
# if(type=="days")
# freq <- ifelse(l>920, 365, ifelse(l>75, 30, 7))
# if(type=="weeks")
# freq <- ifelse(l>150, 52, 1)
# if(type=="months")
# freq <- ifelse(l>30, 12, 1)
#
# original <- ts(original$value, start = original$valdate[1], end = original$valdate[nrow(original)], frequency = freq)
#
# plot(decompose(original))
#
# })
getPlot <- reactive({
datasetName <- datasetSelect()
......@@ -386,7 +428,7 @@ server = shinyServer(
newdates <- seq.Date(max(original$valdate+timeband), by = timeval, length.out = 4)
newvals <- data.frame(Forecast = pointforecast[1:4])
newvals <- data.frame("95% Above" = hi95[1:4], "80% Above" = hi80[1:4], "Point Forecast" = pointforecast[1:4], "80% Below" = lo80[1:4], "95% Below" = lo95[1:4], check.names = FALSE)
newvals <- data.frame(t(newvals))
......@@ -599,7 +641,7 @@ server = shinyServer(
newdates <- seq.Date(max(original$valdate+timeband), by = timeval, length.out = length(pointforecast))
newvals <- data.frame(Date = format(newdates, format="%B %d %Y"), Forecast = pointforecast)
newvals <- data.frame(Date = format(newdates, format="%B %d %Y"), "95% Above" = hi95, "80% above" = hi80, "Forecast" = pointforecast, "80% Below" = lo80, "95% below" = lo95, check.names = FALSE, stringsAsFactors = FALSE)
original <- data.frame(Date = format(original$valdate, format="%B %d %Y"), Value = original$value)
......@@ -735,13 +777,12 @@ ui = #ui.R
uiOutput("dataOptions"),
selectInput("error",
label = "Choose accuracy error metric",
choices = list("Standard MAPE","Adjusted MAPE","Weighted MAPE"),
selected = "Adjusted MAPE"),
uiOutput("errorOptions"),
# selectInput("error",
# label = "Choose accuracy error metric",
# choices = list("Standard MAPE","Adjusted MAPE","Weighted MAPE"),
# selected = "Adjusted MAPE"),
uiOutput("modelSelect"),
width=3
),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment