#BUSNESS OUTLET ANALYSIS I have created data of ten years pertaining to three retail outlets with a view to demonstrate the swings of their performance over the years through plotly animation
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.6.1
library(plotly)
## Warning: package 'plotly' was built under R version 3.6.1
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 3.6.1
## -- Attaching packages ----------------------------------------------- tidyverse 1.2.1 --
## v tibble 2.1.3 v purrr 0.3.2
## v tidyr 1.0.0 v dplyr 0.8.3
## v readr 1.3.1 v stringr 1.4.0
## v tibble 2.1.3 v forcats 0.4.0
## Warning: package 'tidyr' was built under R version 3.6.1
## Warning: package 'dplyr' was built under R version 3.6.1
## Warning: package 'stringr' was built under R version 3.6.1
## -- Conflicts -------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks plotly::filter(), stats::filter()
## x dplyr::lag() masks stats::lag()
This data has been made with an assumption that the business in general improved over the years and one oulet in the bottom ‘B’ overtook the other ‘A’ in Revenue per employee and volume of business. Some fall in business and employee turn overs have also been injected.
df <- read_tsv("business_data.txt")
## Parsed with column specification:
## cols(
## Outlet = col_character(),
## year = col_double(),
## Rpe = col_double(),
## Eno = col_double(),
## BV = col_double()
## )
head(df)
## # A tibble: 6 x 5
## Outlet year Rpe Eno BV
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 A 2005 12 18 11.5
## 2 A 2006 12.5 17 12.0
## 3 A 2007 14 19 14.8
## 4 A 2008 16.4 21 15.6
## 5 A 2009 18 22 17.9
## 6 A 2010 19.9 28 16.9
The variables are Revenue Per Employee Rpe, –> No. of Employees Eno and Business Volume BV –> The Rpe is Rs. in lakhs and BV is Rs. in Crores –>
gg <- ggplot(df,aes(year,Rpe, color = Outlet))+
geom_point(aes(size = BV, frame= year, ids = Outlet))+
scale_x_log10()
## Warning: Ignoring unknown aesthetics: frame, ids
ggplotly(gg)
The increase in no. of employees, change in business world, Performance efficiency, turn over etc may be the hidden stories behind the movements of the business of the outlets ‘A’ , ‘B’ & ‘C’ bubbles which grow as we move along.
This exercise is purely fictitious and intended to test my R skills! Thanks for your time.