Page 1

Row 1

Articles per Day

45

Comments per Day

126

Spam per Day

20

Spam per Day

Row 2

ggplot2 plots

This displays the limit balance for each person in NTD.

Row 3

Tables

Page 2

htmlwidget

---
title: "Flexdashboard example"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: "menu"
    source_code: embed
---
 
```{r setup, include=FALSE}
```


```{r setup, include=FALSE}
knitr::opts_chunk$set(cache = TRUE, message = FALSE, warning = FALSE)
```

```{r load-packages, include = FALSE}
library(tidyverse)
library(plotly)
library(kableExtra)
library(flexdashboard)
library(DT)
library(rsconnect)
library(shiny)
```

```{r load-data, include = FALSE}
credit_df_clean <- read_csv("UCI_Credit_Card_2_small_clean.csv")
```
# Intro Text {.sidebar}
This dataset contains information on default payments, demographic factors, credit data, history of payment, and bill statements of credit card clients in Taiwan from July 2005 to September 2005

# Page 1

## Row 1

### Articles per Day
````{r}
valueBox(value = 45, icon = "fa-wordpress", color = "purple")
````
### Comments per Day
````{r}
valueBox(value = 126, icon = "fa-regular fa-comment-dots")
````

### Spam per Day
````{r}
spam <-  20
valueBox(value = spam, icon = "fa-solid fa-trash-arrow-up", color = ifelse(spam > 10, "warning", "primary"))
````
### Spam per Day
````{r}
spam <-  20

gauge(value = spam, min =0, max = 30, 
      sectors = gaugeSectors(success = c(0,8),
                             warning = c(9, 18),
                             danger = c(19, 30)
                             )
)
````

## Row 2


### ggplot2 plots 
This displays the limit balance for each person in NTD.
```{r, echo = FALSE, fig.height=4, fig.width=5, fig.align='center'}
credit_df_clean %>%  
  ggplot(aes(x = limit_bal)) + 
  geom_histogram(fill = '#006633', 
                 colour = "black",
                 bins = 11) +  
  xlab("Limit balance") +
  theme_bw()  
```

## Row 3

### Tables
```{r}
datatable(credit_df_clean, options = list(pageLength = 10))
```

# Page 2



### htmlwidget 

```{r}

fig <- credit_df_clean %>%  
  ggplot(aes(y = limit_bal, x = education,
             fill = education)) + 
  geom_boxplot() + 
  ylab("Limit balance") +
  theme_bw() 

ggplotly(fig)

```