#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(ggplot2)
library(DT)
#library(plotly)
ui <- fluidPage(
# App title ----
titlePanel("SAMRAT INVENTROY FORECASTING APPLICATION"),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
#FILE INPUT
fileInput('file1', 'Choose file to upload',
accept = c(
'text/csv',
'text/comma-separated-values',
'text/tab-separated-values',
'text/plain',
'.tsv'
)
),
checkboxInput("header", "Header", TRUE),
radioButtons("disp", "Display",
choices = c(Head = "head",
All = "all"),
selected = "head"),
#ploting sales
selectInput("x", "Select the first X variable:",
choices = c("Sales" = "Sales",
"Quantity" = "Quantity",
"Discount" = "Discount",
"Profit" = "Profit")),
selectInput("y", "Select the first Y variable:",
choices = c("Sales" = "Sales",
"Quantity" = "Quantity",
"Discount" = "Discount",
"Profit" = "Profit")),
#ploting the regression model
actionButton(inputId = "click3", label = "Plot Regression Model Residuals"),
hr(),
#ploting the sales prediction
actionButton(inputId = "click4", label = "Plot Sales Prediction"),
hr(),
#predict per product
selectInput("pre", "Predicting Per Product Category:",
choices = c("Funiture" = "funi",
"Office Supplies" = "off",
"Technology" = "tech")),
actionButton(inputId = "click5", label = "Predict"),
#DISTRIBUTION TYPE
radioButtons("dist", "TYPE OF GRAPH TO PLOT:",
choices = c("BAR GRAPH" = "bar",
"HISTOGRAM" = "hist",
"BOX PLOT" = "box",
"DENSITY" = "density"), selected = "BAR GRAPH"),
hr(),
# Input: Slider for the number of observations to generate ----
sliderInput("n",
"Number of observations:",
value = 500,
min = 1,
max = 1000)
),
# Main panel for displaying outputs ----
mainPanel(
#DT::dataTableOutput('contents'),
# Output: Tabset data, salesanalysis, and predictions ----
tabsetPanel(type = "tabs",
tabPanel(h2('CONTENTS'), dataTableOutput('contents')),
tabPanel("Sales Analysis", plotOutput("salesanalysis")),
tabPanel("Predictions", plotOutput("predictions"))
)
)
)
)