Skip to content

Commit db940f9

Browse files
committed
QMD
1 parent 4388be8 commit db940f9

File tree

2 files changed

+21
-34
lines changed

2 files changed

+21
-34
lines changed
Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,27 @@
1-
21
---
32
title: "MEL Dashboard Summary"
43
format: html
54
editor: visual
65
---
76

8-
```{r setup}
7+
```{r}
8+
# Load required libraries
99
library(tidyverse)
10-
source("scripts/mel_reshape.R")
11-
```
1210
13-
## 📥 Load MEL Indicator Data
14-
15-
```{r}
16-
df <- read.csv("sample_data/mel_indicators_wide.csv")
17-
head(df)
18-
```
11+
# Sample input (replace with real data or read.csv)
12+
df <- data.frame(
13+
Indicator = c("Coverage", "Access", "Retention"),
14+
DistrictA = c(0.82, 0.76, 0.91),
15+
DistrictB = c(0.67, 0.71, 0.85)
16+
)
1917
20-
---
18+
# Reshape for dashboard
19+
df_long <- df %>%
20+
pivot_longer(-Indicator, names_to = "District", values_to = "Score")
2121
22-
## 🔄 Reshape to Dashboard Format
22+
# Save as dashboard-ready CSV
23+
write.csv(df_long, "dashboard_export.csv", row.names = FALSE)
2324
24-
```{r}
25-
df_long <- reshape_indicators(df)
25+
# Display preview table
2626
head(df_long)
2727
```
28-
29-
---
30-
31-
## 📤 Export for Looker Studio or Power BI
32-
33-
```{r}
34-
write.csv(df_long, "outputs/mel_indicators_long.csv", row.names = FALSE)
35-
```
36-
37-
---
38-
39-
## 📊 Visual Check
40-
41-
```{r}
42-
ggplot(df_long, aes(x = quarter, y = value, fill = indicator)) +
43-
geom_col(position = "dodge") +
44-
facet_wrap(~ program) +
45-
labs(title = "Dashboard-Ready MEL Indicators") +
46-
theme_minimal()
47-
```

sample_data/dashboard_export.csv

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Indicator,District,Score
2+
Coverage,DistrictA,0.82
3+
Access,DistrictA,0.76
4+
Retention,DistrictA,0.91
5+
Coverage,DistrictB,0.67
6+
Access,DistrictB,0.71
7+
Retention,DistrictB,0.85

0 commit comments

Comments
 (0)