Questions

I collected data from my bank statement that i converteded into a CSV file. The Time period is from September till December 2. The idea is to identify where i can cut some cost to leave some cash for investment opportunities.

  1. Does my spending varies from month to month?
  2. In which category i spend the most?
  3. What those categories are made off?
  4. What are the spendings that i can get rid off?
  5. How much more can I save?

Expenses By Month


  1. Does my spending varies from month to month?

Expenses By Category (% of Total)


  1. In which category i spend the most?

Expenses By Detail (% of Total)


  1. What those categories are made off?

Expenses By Category


  1. What are the spendings that i can get rid off?

In the house expense, there is a fixed expense which is rent, but there is also a one time expense which is the deposit. Also there some cost related to car that are a one in while expense that will not happen every month. Also, as my birthday was in october, i spent more in activities and treated myself for my hardwork.

Expense Amount Detail


  1. How much more can I save?

Definitely all cost allocated to car maintenance, tag, xtremexperience can be saved.

---
title: "Final Project ANLY 512"
author: Mehdi Alaoui
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    storyboard: true
    vertical_layout: fill
    social: menu
    source_code: embed
---

```{r setup, include=FALSE, message=FALSE, echo= FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(flexdashboard)
library(dplyr)
library(reshape2)
library(ggplot2)
library(plotly)
```

### Questions

I collected data from my bank statement that i converteded into a CSV file. The Time period is from September till December 2. The idea is to identify where i can cut some cost to leave some cash for investment opportunities.

 1. Does my spending varies from month to month?
 2. In which category i spend the most?
 3. What those categories are made off?
 4. What are the spendings that i can get rid off?
 5. How much more can I save? 
 


### Expenses By Month

```{r, message=FALSE, warning=FALSE, echo=FALSE}

Data <- read.csv('Project/Data.csv', header = TRUE, stringsAsFactors = FALSE)

Data <- as.data.frame(Data)

expenses <- subset(Data, Data$Category == 'Expense')

E <- expenses%>%
  group_by(Month)%>%
  summarize(Amount=sum(Amount))
  
p <-plot_ly(E, x = ~Month, y = ~Amount, type = 'bar', name = 'Income', marker = list(color = 'rgb(49,130,189)'))%>%
      layout(xaxis = list(title = "", tickangle = -45),
         yaxis = list(title = ""),
         margin = list(b = 100),
         barmode = 'group')
ggplotly(p)

```

***

1. Does my spending varies from month to month?

  - This graph shows that my spending pattern is changing for month to month. I was expecting some variation but i didn't think that it is going to be that important
  
  

### Expenses By Category (% of Total)   

```{r 1, message=FALSE, warning=FALSE, echo=FALSE, fig.width=7}

E <- expenses%>%
  group_by(Expense.Type)%>%
  summarize(Amount=sum(Amount))
  

p <- plot_ly(E, labels = ~Expense.Type, values = ~Amount, type = 'pie',textposition = 'inside',textinfo = 'label+percent',insidetextfont = list(color = '#FFFFFF'),
        hoverinfo = 'text',
        text = ~paste(Expense.Type, '% of total'))%>%
  layout(title = 'Expenditure by Category',
         xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
         yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
ggplotly(p)


```

***

2. In which category i spend the most?

  - It seems that the biggest chunk of my expenses are house related, followed by expenses allocated to my car followed by fun. School in this case doesn't include tuition as i collected data starting september and tuition was paid before.
  
### Expenses By Detail (% of Total)  

```{r 2, message=FALSE, warning=FALSE, echo=FALSE}

E <- expenses%>%
  group_by(Detail)%>%
  summarize(Amount=sum(Amount))

p <- plot_ly(E, labels = ~Detail, values = ~Amount, type = 'pie',textposition = 'inside',textinfo = 'label+percent',insidetextfont = list(color = '#FFFFFF'),
        hoverinfo = 'text',
        text = ~paste(Detail, '% of total'))%>%
  layout(title = 'Expenditure Detailed',
         xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
         yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
ggplotly(p)


```

***

3. What those categories are made off?

- The house related expenditure are here subdivided into rent, groceries, FPL and water expense. Car expenses include insurance, Gas and maintenance. Fun includes restaurant and some other activities like casino and racing.

### Expenses By Category

```{r 3, message=FALSE, warning=FALSE, echo=FALSE}
E <- expenses%>%
  group_by(Expense.Type)%>%
  summarize(Amount=sum(Amount))
  
p <-plot_ly(E, x = ~Expense.Type, y = ~Amount, type = 'bar', name = 'Income', marker = list(color = 'rgb(49,130,189)'))%>%
      layout(xaxis = list(title = "", tickangle = -45), 
         yaxis = list(title = ""),
         margin = list(b = 100),
         barmode = 'group')
ggplotly(p)

```

***

4. What are the spendings that i can get rid off?

  In the house expense, there is a fixed expense which is rent, but there is also a one time expense which is the deposit. Also there some cost related to car that are a one in while expense that will not happen every month. Also, as my birthday was in october, i spent more in activities and treated myself for my hardwork.

### Expense Amount Detail

```{r 4, message=FALSE, warning=FALSE, echo=FALSE}
E <- expenses%>%
  group_by(Detail)%>%
  summarize(Amount=sum(Amount))
  
p <-plot_ly(E, x = ~Detail, y = ~Amount, type = 'bar', name = 'Income', marker = list(color = 'rgb(49,130,189)'))%>%
      layout(xaxis = list(title = "", tickangle = -45),
         yaxis = list(title = ""),
         margin = list(b = 100),
         barmode = 'group')
ggplotly(p)

```

***

5. How much more can I save?

Definitely all cost allocated to car maintenance, tag, xtremexperience can be saved.