Git Product home page Git Product logo

data-visualization-with-r's Introduction

Retail Sales Forecasting Application

This R Shiny application provides a user interface for visualizing historical sales data and generating sales forecasts for a selected store. The application uses various R packages for data manipulation, visualization, and forecasting.

Features

  • Historical Sales Data Visualization: View historical weekly sales data for a selected store.
  • Sales Forecasting: Generate and visualize sales forecasts using the ARIMA model.

Setup Instructions

Prerequisites

Ensure you have R and RStudio installed on your machine. You can download them from the following links:

Installation

  1. Install Required Packages

    Open R or RStudio and run the following command to install the necessary packages:

         install.packages(c("fastmap", "shiny", "forecast", "ggplot2", "tidyverse", "DT"))
  2. Load the Libraries Ensure the required libraries are loaded by running:

    library(fastmap)
    library(shiny)
    library(forecast)
    library(ggplot2)
    library(tidyverse)
    library(DT)

Running the Application

  1. Download the Application Code

Save the provided R script (IndividualAssignment.R) to your local machine.

  1. Run the Application

To run the application, use the following command in your R console:

    shiny::runApp("path/to/IndividualAssignment.R")

Replace "path/to/IndividualAssignment.R" with the actual path to the script file.

Application Usage

  1. Select Store Use the dropdown menu to select the store for which you want to view historical sales data and generate forecasts.

  2. Generate Forecast Click the "Generate Forecast" button to create a sales forecast for the selected store. The application will display the forecasted sales alongside the actual sales for the most recent quarter.

Application Structure

  • UI (User Interface): Defined using fluidPage, sidebarLayout, and mainPanel to create a user-friendly interface.
  • Server: Contains the logic for data processing, visualization, and forecasting.
    • Reactive Data: Filters sales data based on the selected store.
    • Historical Sales Table and Plot: Displays historical sales data in a table and plot.
    • Sales Forecast: Uses the ARIMA model to forecast sales and visualize the results.

Data Source

The sales data is sourced from a CSV file hosted online:

    fsales <- "https://raw.githubusercontent.com/multidis/hult-inter-bus-reports-r/main/forecasting/sales_weekly.csv"
    sales <- read_csv(fsales)

Troubleshooting

If you encounter any issues, ensure all packages are correctly installed and loaded. If the problem persists, try reinstalling the problematic package(s).

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • The shiny package for creating interactive web applications.
  • The forecast package for time series forecasting.
  • The tidyverse and ggplot2 packages for data manipulation and visualization.
  • The DT package for rendering data tables. Feel free to contribute to this project by submitting issues or pull requests. Happy forecasting! ```

data-visualization-with-r's People

Contributors

gbolarhan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.