-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.qmd
87 lines (67 loc) · 1.98 KB
/
dashboard.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
title: "Fellow Dashboard"
format:
dashboard:
logo: "images/logo.png"
orientation: columns
---
```{r}
#| label: setup
#| echo: false
#| include: false
library(tidyverse)
library(gt)
library(plotly)
df <-
readRDS("all_cohort_data_copy") |>
filter(year==2024) |>
mutate(across(ends_with("_date"), ~as_date(.)))
```
## column
```{r}
df |>
select(name, site, track, company, role) |>
gt() |>
tab_header(title = "2024 Fellows") |>
opt_interactive(use_filters = TRUE,
use_page_size_select = TRUE)
```
## column
Our **2024** Cohort began with `r df |> nrow()` Fellows with `r df |> filter(site=="Boston") |> nrow()` Fellows in Boston and `r df |> filter(site=="New York") |> nrow()` in New York. Currently, there are `r df |> filter(program_status=="in progress") |> nrow()` Fellows still enrolled in the program.
```{r}
p <-
df |>
filter(!is.na(attrition_date)) |>
ggplot(aes(x = track,
color = attrition_period)) +
geom_point(stat = "count") +
ylim(c(0, 8)) +
labs(title = "Attrition",
x = "Track",
y = "Count",
color = "") +
theme_bw() +
theme(plot.title = element_text(face = "bold"))
ggplotly(p)
```
## column
Breakdown of Number of Fellows Per Program Lead
```{r}
df |>
mutate(row = row_number(),
pl = case_when(row<33 ~ "Bob", row>33 & row<=66 ~ "Karen", TRUE ~ "Sally")) |>
group_by(pl) |>
summarize(count = n(), .groups = "drop") |>
arrange(desc(count)) |>
mutate(ypos = cumsum(count)-0.5*count) |>
ggplot(aes(x="", y=count, fill=pl)) +
geom_bar(stat="identity", width=1, color = "white") +
coord_polar("y", start=0) + theme_void() +
geom_text(aes(y = ypos, label = paste0(pl, " - ", count)), color = "white") +
scale_fill_manual(values = c("dodgerblue4", "dodgerblue2", "firebrick2")) +
labs(title = "Breakdown of Fellows by Program Lead") +
theme(plot.title = element_text(hjust = 0.5),
plot.title.position = "plot")
```
```{r}
```