Table

Table

Bar-chart

## Column

Importance Product

Shipment Mode

Pie-chart

CS Calls

---
title: "Shipping Report"
output: 
  flexdashboard::flex_dashboard:
    vertical_layout: scroll
    theme: yeti
    source_code: embed
---

```{r setup, include=FALSE}
# Importing libraries
library(flexdashboard)
library(tidyverse)
library(highcharter)
library(gt)
library(htmltools)
library(viridis)
library(DT)
```


```{r}
# Importing data
dataecom <- read_csv('E-commerce.csv')
```

Table {data-orientation=rows}
=======================================================================

### Table {data-height=520}

```{r}
datatable(dataecom, 
          extensions = 'Buttons', 
          options = list(dom = 'Bfrtip',
                         buttons = c('Copy', 'Print', 'CSV')))
```


Bar-chart {data-orientation=rows}
=======================================================================


## Column {.tabset .tabset-fade data-height=520}
-----------------------------------------------------------------------

### Importance Product {data-width=1200}

```{r}
#Who Purchased Imp products
imp<-table(dataecom$Product_importance,dataecom$Gender)

barplot(imp,beside = TRUE, 
        col = c("Red", "skyblue1","skyblue3"), 
        main = "Who Purchased Imp products", 
        width=c(2,3),
        legend.text = rownames(imp),
        args.legend = list(cex=1.5,x = "center"))

```

### Shipment Mode {data-width=1200}

```{r}
#Shipment mode With most customers calls
shp<-aggregate(dataecom$Customer_care_calls~dataecom$Mode_of_Shipment, FUN = sum)

barplot(shp$`dataecom$Customer_care_calls`, names.arg=shp$`dataecom$Mode_of_Shipment`,
        main = "Shipment mode With most customers calls", 
         xlab ="Mode", ylab = "calls", 
        col = c("Red", "Yellow","Green")
)
```

Pie-chart {data-orientation=rows}
=======================================================================

### CS Calls {data-width=600 data-height=510}

```{r fig.height=5}
#Warehouse with highest calls Customer care calls 
ware<-aggregate(dataecom$Customer_care_calls~dataecom$Warehouse_block,FUN=sum)


pie(ware$`dataecom$Customer_care_calls`, labels = ware$`dataecom$Customer_care_calls`,
      main ="Warehouse with highest calls Customer care calls",
      col = rainbow(length(ware$`dataecom$Warehouse_block`)))
      legend("bottomleft", c("A Block","B Block","C Block", "D Block","F Block"), cex = 0.5,
      fill = rainbow(length(ware$`dataecom$Warehouse_block`))
    )
```