---
title: "EDA QUINE DATASET"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
theme: paper
social: menu
source_code: embed
---
```{r setup, include=FALSE}
library(flexdashboard)
library("ggplot2")
library(dplyr)
library(DT)
data("diamonds")
attach(diamonds)
```
## Dataset Description {.tabset}
### dataset Structure
```{r}
str(diamonds)
```
### summary
```{r}
summary(diamonds)
```
## univariate Analysis {.tabset}
### Histogram of Carat
```{r}
ggplot(diamonds ,aes(carat)) +
geom_histogram( fill = "skyblue", color = "black") +
geom_vline(xintercept = mean(carat), color = "red", linetype = "dashed") +
geom_vline(xintercept = median(carat), color = "green", linetype = "dashed") +
labs(title = "Histogram of Carat",
x = "Carat Value",
y = "Count")
```
### Histogram for price
```{r}
ggplot(diamonds ,aes(price)) +
geom_histogram( fill = "skyblue", color = "black") +
geom_vline(xintercept = mean(price), color = "red", linetype = "dashed") +
geom_vline(xintercept = median(price), color = "green", linetype = "dashed") +
labs(title = "Histogram for price",
x = "Price",
y = "Frequence") +
xlim(c(0,10000))
```
### cut Quality
```{r}
ggplot(diamonds, aes(x = cut)) +
geom_bar(fill = "skyblue", color = "black") + # Basic barplot with color
labs(title = "Count of Diamonds by Cut Quality",
x = "Cut Quality",
y = "Count")
```
### Color
```{r}
ggplot(diamonds, aes(x = color)) +
geom_bar(fill = "skyblue", color = "black") + # Basic barplot with color
labs(title = "Count of Diamonds by COlor",
x = "Color",
y = "Count")
```
### Clarity
```{r}
ggplot(diamonds, aes(x = clarity)) +
geom_bar(fill = "skyblue", color = "black") + # Basic barplot with color
labs(title = "Count of Diamonds by clarity",
x = "clarity",
y = "Count")
```
### Carat vs. Price colored by Cut
```{r}
ggplot(diamonds, aes(x = carat, y = price, color = cut)) +
geom_point(alpha = 0.5) +
labs(title = "Carat vs. Price colored by Cut")
```
### Price distribution across Cuts and Colors
```{r}
ggplot(diamonds, aes(x = cut, y = price, fill = color)) +
geom_boxplot() +
labs(title = "Price distribution across Cuts and Colors")
```
### Price distribution across Clarity and Colors
```{r}
ggplot(diamonds,aes(x=clarity,y=price,fill=color)) +
geom_boxplot()+
labs(title = "Price distribution across Clarity and Colors")
```
### Boxplot of Diamond Prices by Color
```{r}
ggplot(diamonds, aes(x = color, y = price)) +
geom_boxplot() + # Create the boxplot
labs(title = "Boxplot of Diamond Prices by Color",
x = "Cut Quality",
y = "Price (in USD)")
```
### Boxplot of Diamond Prices by Cut
```{r}
ggplot(diamonds, aes(x = cut, y = price)) +
geom_boxplot() + # Create the boxplot
labs(title = "Boxplot of Diamond Prices by Cut",
x = "Cut Quality",
y = "Price (in USD)")