Hi,
I have installed shiny server on ubuntu 18.04 on EC2 instance. I am trying to deploy a shiny app using shinyapps.io. So basically the data used for my app is been pulled from snowflake. The app works perfectly fine with Run App. But when we publish using shinyapps.io it says error has occured. Below is the code
library(shiny)
library(forecast)
Define UI for application
ui <- fluidPage(
# Application title
titlePanel("Forecasting Model"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of weeks:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot"),
tableOutput("dataTable")
)
)
)
Define server logic
server <- function(input, output) {
output$distPlot <- renderPlot({
library(forecast)
#setwd("D:/Edgematrics-official/Forcaste")
forecast<-DBI::dbGetQuery(con,"SELECT * FROM FORECAST_WEEKLY")
y=ts(forecast[,2],start=c(2010,2),frequency=52)
fit_arima<-auto.arima(y,d=1,D=1,stepwise = FALSE,approximation = FALSE,trace = TRUE)
fst<-forecast(fit_arima,h=input$bins)
plot(fst)
#print(summary(fst))
})
output$dataTable<-renderTable({
#setwd("D:/Edgematrics-official/Forcaste")
forecast<-DBI::dbGetQuery(con,"SELECT * FROM FORECAST_WEEKLY")
y=ts(forecast[,2],start=c(2010,2),frequency=52)
fit_arima<-auto.arima(y,d=1,D=1,stepwise = FALSE,approximation = FALSE,trace = TRUE)
fst<-forecast(fit_arima,h=input$bins)
head(print(summary(fst)))
})
}
Run the application
shinyApp(ui = ui, server = server)
Please help me with this.