Hi Friends ,
UI elements are not visible [ PlotP2 and Skew2].
Server code works fine, but the elements simply don't appear on the tab panel UI.
When the sequence [ PlotP1 and Skew] are replaced with [PlotP2 and Skew2 ] elements are replaced the elements are seen.
Please help how can this be addressed. is this some Page length issue.
library(shiny)
library(tidyverse)
library(e1071)
Relevant UI Code
mainPanel(
tabsetPanel(
tabPanel("Forecast Accuracy",
tableOutput("Accuracy"),
hr(),
p("The Skewness of Sales Data"),
verbatimTextOutput("skew"),
br(),
p("This is a plot of Distribution of Sales Data"),
plotOutput(outputId = "PlotP1",width="100%",height="200px")),
hr(),
p(""),
verbatimTextOutput("skew2"),
plotOutput(outputId = "PlotP2",width="100%",height="200px")
)
Relevant Server Code
output$Accuracy<-renderTable({
mape <- 100-mean(MAPEBase()$dev)
vol_mape <- 100-sum(Vol_WtMAPE()$Wt_dev)
value_mape <- 100-sum(Val_WtMAPE()$Wt_dev)
mse <- mean(MSE()$dev_SE)
rmse <- (mean(MSE()$dev_SE))^0.5
mad <- mean(MADBase()$dev)
Sales<- sum(MAPEBase()$V_s)
SalesAvg<-mean(MAPEBase()$V_s)
Forecast <-sum(MAPEBase()$V_F)
ForecastAvg<-mean(MAPEBase()$V_F)
data.frame(Sales,SalesAvg,Forecast,ForecastAvg,mape,vol_mape,value_mape,mse,rmse,mad)
})
output$PlotP1 <- renderPlot({
ggplot(MAPEBase(),aes(MAPEBase()$V_s))+
geom_histogram(bins=20)+
xlab("Distributuin of Sales By Product")
})
output$PlotP2 <- renderPlot({
ggplot(MAPEBase(),aes(MADBase()$dev))+
geom_histogram(bins=20)+
xlab("Distribution of Deviations By Product")
})
output$skew <-renderPrint({skewness(MAPEBase()$V_s)})
output$skew2 <-renderPrint(skewness(MADBase()$dev))
}
shinyApp(ui=ui,server=server)