Introduction

Greeting

Greeting From AMH 🥰

Thank you for sharing webinar session. Merry Christmas and Happy New Year.

About Training

Total Participants

100

Training Participant by Gender

Training Progress

Cars

About car1

Car data

                   mpg cyl disp  hp drat    wt  qsec vs am gear carb
Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1

Hp Vs Mpg by cyl

About car2

Box plot

Faceted plot

Iris

About iris1

Iris Data

  Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1          5.1         3.5          1.4         0.2  setosa
2          4.9         3.0          1.4         0.2  setosa
3          4.7         3.2          1.3         0.2  setosa
4          4.6         3.1          1.5         0.2  setosa
5          5.0         3.6          1.4         0.2  setosa
6          5.4         3.9          1.7         0.4  setosa

Scatter Plot

About iris2

Box plot

Histogram for Petal Width

---
title: "Dashboard-AMH"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill #scroll & fill
    social: menu
    source_code: embed
    self_contained: true
    theme: spacelab
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(plotly)    # Added for interactive plots
```

# Introduction {data-icon="fa-home"}

## Greeting {data-width="500"}

### Greeting From AMH 🥰

Thank you for sharing webinar session. Merry Christmas and Happy New Year.

![](images/8064949.jpg)

## About Training {data-width="500"}

### Total Participants

```{r}
flexdashboard::valueBox(
  value=100,
  caption= "Total Participants",
  icon= "fa-users",
  color= "darkblue"
)
```

### Training Participant by Gender

```{r}
gender_counts <- c(45, 55)
names(gender_counts) <- c("Male", "Female")

pie(gender_counts,
    main = "Gender Distribution", # Title
    col = c("lightblue", "pink"), # Colors for Male, Female
    labels = paste0(names(gender_counts), "\n", gender_counts, "%") # Labels with names & %
)

legend("topright", legend = names(gender_counts), fill = c("lightblue", "pink"))
```

### Training Progress

```{r}
Training_access =89
gauge(Training_access, 
      min = 0, max = 100, 
      label = "Success %",
      symbol = "%",
      # Color changes based on value
      sectors = gaugeSectors(success = c(70, 100), warning = c(50, 69), danger = c(0, 49)))

```

# Cars

## About car1 {data-width="500"}

### Car data

```{r}
head (mtcars)
```

### Hp Vs Mpg by cyl

```{r}
p1<- ggplot(mtcars, aes(x = hp, y = mpg)) +
  geom_point(aes(color = factor(cyl), size = wt), alpha = 0.7) +
   labs(title = "MPG vs Horsepower",
       x = "Horsepower",
       y = "Miles Per Gallon",
       color = "Cylinders",
       size = "Weight") +
  theme_minimal()
ggplotly(p1)
```

## About car2 {data-width="500"}

### Box plot

```{r}
p2 <- ggplot(mtcars, aes(x = factor(cyl), y = mpg, fill = factor(cyl))) +
  geom_boxplot(alpha = 0.7) +
  geom_jitter(width = 0.2, alpha = 0.5) +
  labs(title = "MPG Distribution by Cylinder Count",

              x = "Number of Cylinders",
       y = "Miles Per Gallon") +
  theme_classic() +
  theme(legend.position = "none")
ggplotly(p2)
```

### Faceted plot

```{r}
p3 <- ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point(aes(color = factor(cyl))) +
  geom_smooth(method = "lm", se = FALSE) +
  facet_wrap(~ cyl, ncol = 3) +
  labs(title = "MPG vs Weight by Cylinder Count",
       x = "Weight (1000 lbs)",
       y = "Miles Per Gallon") +
  theme_bw()
ggplotly(p3)
```

# Iris

## About iris1 {data-width="500"}

### Iris Data
```{r}
head(iris)
```

### Scatter Plot

```{r}
iris1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
  geom_point(size = 3) +
  labs(title = "Sepal Length vs Sepal Width",
       x = "Sepal Length (cm)",
       y = "Sepal Width (cm)") +
  theme_minimal()
ggplotly(iris1)
```

## About iris2 {data-width="500"}
### Box plot

```{r}
iris2 <- ggplot(iris, aes(x = Species, y = Petal.Length, fill = Species)) +
  geom_boxplot() +
  labs(title = "Distribution of Petal Length by Species") +
  theme_classic()
ggplotly(iris2)
```

### Histogram for Petal Width
```{r}
iris3 <- ggplot(iris, aes(x = Petal.Width, fill = Species)) +
  geom_histogram(binwidth = 0.2, color = "white", alpha = 0.7) +
  facet_wrap(~Species) +
  labs(title = "Petal Width Frequency by Species")
ggplotly(iris3)
```