Column

Executive Summary

I collected my consume historical data from my credit card in 2018, to analyze my consume behavior across location and timeline in the past year.

What is the monthly expending in 2018

Which category that I spend most in 2018?

Which Location that my card was charged mostly in 2018?


What Category consume distribution during the first half year in 2018

What Category consume distribution during the second half year in 2018

---
title: "ANLY512-Final Project"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source: embed
    storyboard: true
---

```{r setup, include=FALSE}
library(flexdashboard)
library(knitr)
library(ggplot2)
library(tidyverse)
library(readxl)
library(dplyr)
library(xts)
library(zoo)
```

Column {data-width=650}
-----------------------------------------------------------------------
### Executive Summary
I collected my consume historical data from my credit card in 2018, to analyze my consume behavior across location and timeline in the past year. 

### What is the monthly expending in 2018 

```{r}
data1<-read_xlsx("/Users/jwu/Documents/ANLY512-Final Project-1.xlsx")
Month<- ggplot(data1, aes(x = data1$Month, y=data1$Amount)) + geom_bar(stat = "identity", fill = "Orange")+scale_x_discrete(limits=c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")) +labs(title = "Monthly Expending", x = "Month", y = "Amount") +theme_minimal()
Month

```

### Which category that I spend most in 2018? 

```{r}
data2<-read_xlsx( "/Users/jwu/Documents/ANLY512-Final Project-2.xlsx")
category <- ggplot(data2, aes(x=data2$Category, y=data2$Amounts, fill=Category)) + geom_bar(stat = "identity", fill = "LightBlue")+labs(title = "Spending across Category", x = "Category", y = "Amount") + coord_flip()
category

```

### Which Location that my card was charged mostly in 2018?

```{r}
data3<-read_xlsx("/Users/jwu/Documents/ANLY512-Final Project-3.xlsx")
dotchart(data3$Amount,labels = data3$Location, cex=1, color = "red", main = "Expenditures by locations")
```

-----------------------------------------------------------------------

### What Category consume distribution during the first half year in 2018

```{r}
data4<-read_xlsx("/Users/jwu/Documents/ANLY512-Final Project-4.xlsx")
month1 <- ggplot(data4, aes(x=data4$Month, y=data4$Amount)) +   
  geom_bar(aes(fill = data4$Category),  stat="identity") +
  labs(title = "Monthly Expenditure by Category in Jan-June, 2018", x = "Month", y = "Amount") +
  scale_x_continuous(breaks=c(1,2,3,4,5,6)) +
  theme(legend.position = "Right") +
  scale_fill_discrete(name="Category") +
  theme(legend.position = "right")

month1
```
 
### What Category consume distribution during the second half year in 2018

```{r}
data5<-read_xlsx("/Users/jwu/Documents/ANLY512-Final Project-5.xlsx")
month2 <- ggplot(data5, aes(x=data5$Month, y=data5$Amount)) +   
  geom_bar(aes(fill = data5$Category),  stat="identity") +
  labs(title = "Monthly Expenditure by Category in Jul-Dec, 2018", x = "Month", y = "Amount") +
  scale_x_continuous(breaks=c(7,8,9,10,11,12)) +
  theme(legend.position = "Right") +
  scale_fill_discrete(name="Category") +
  theme(legend.position = "right")

month2
```