Commit 448a4987 authored by Aqeel Padaria's avatar Aqeel Padaria

add quarters support

parent 3870f715
......@@ -294,6 +294,8 @@ server = shinyServer(
timeval <- "weeks"
if(input$timefactor == "month")
timeval <- "months"
if(input$timefactor == "quarter")
timeval <- "quarters"
if(input$timefactor == "year")
timeval <- "years"
timeval
......@@ -367,7 +369,7 @@ server = shinyServer(
lo80 <- as.numeric(unlist(Models[mod+3,periods]))
lo95 <- as.numeric(unlist(Models[mod+4,periods]))
timeband <- ifelse(timeval=="days", 1, ifelse(timeval=="weeks", 7, ifelse(timeval=="months", 30, ifelse(timeval=="years", 365, 1))))
timeband <- ifelse(timeval=="days", 1, ifelse(timeval=="weeks", 7, ifelse(timeval=="months", 30, ifelse(timeval=="quarters", 90, ifelse(timeval=="years", 365, 1)))))
newvals <- data.frame(valdate = seq.Date(max(original$valdate+timeband), by = timeval, length.out = length(pointforecast)), value = NA, fit = NA, newval = pointforecast, hi95 = hi95, hi80 = hi80, lo95 = lo95, lo80 = lo80)
......@@ -431,7 +433,7 @@ server = shinyServer(
lo80 <- as.numeric(unlist(Models[mod+3,periods]))
lo95 <- as.numeric(unlist(Models[mod+4,periods]))
timeband <- ifelse(timeval=="days", 1, ifelse(timeval=="weeks", 7, ifelse(timeval=="months", 30, ifelse(timeval=="years", 365, 1))))
timeband <- ifelse(timeval=="days", 1, ifelse(timeval=="weeks", 7, ifelse(timeval=="months", 30, ifelse(timeval=="quarters", 90, ifelse(timeval=="years", 365, 1)))))
newdates <- seq.Date(max(original$valdate+timeband), by = timeval, length.out = 4)
......@@ -644,7 +646,7 @@ server = shinyServer(
lo80 <- as.numeric(unlist(Models[mod+3,periods]))
lo95 <- as.numeric(unlist(Models[mod+4,periods]))
timeband <- ifelse(timeval=="days", 1, ifelse(timeval=="weeks", 7, ifelse(timeval=="months", 30, ifelse(timeval=="years", 365, 1))))
timeband <- ifelse(timeval=="days", 1, ifelse(timeval=="weeks", 7, ifelse(timeval=="months", 30, ifelse(timeval=="quarters", 90, ifelse(timeval=="years", 365, 1)))))
newdates <- seq.Date(max(original$valdate+timeband), by = timeval, length.out = length(pointforecast))
......
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