Column

DLT1 Network Graph by Region

---
title: "Which regions do the most central actors in the MOOC-Ed DLT1 course come from?"
output: 
  flexdashboard::flex_dashboard:
    theme:
      bg: "#FFFFFF"
      fg: "#000000" 
      primary: "#eb4034"
      base_font:
        google: Poppins
      code_font:
        google: JetBrains Mono
    orientation: columns
    vertical_layout: fill
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
```

```{r}
install.packages("tidyverse")
install.packages("tidygraph")
install.packages("ggraph")
install.packages("janitor")
install.packages("igraph")
install.packages("readxl")
library(tidyverse)
library(tidygraph)
library(ggraph)
library(janitor)
library(igraph)
library(readxl)
```

##  {.sidebar}

The DLT1 MOOC-Ed course contains actors from various regions in the US and Internationally. These are the South (172 actors), Northeast (111 actors), Midwest (77 actors), West (52 actors) and International (32 actors). Based on the network graph to the right, which gives a visualization of the network's centralization, actors that appear to be the most central, based on out-degree measures, in the network come from the South, followed by the International and the Midwest.

However, the out-degree centralization calculation, the value measured at .22, which shows that while there is some centralization, may also suggest that despite region, not one single region necessarily contributes more to the MOOC-Ed discussion posts than the other overall.

## Column

### DLT1 Network Graph by Region {.tabset data-width="1600"}

```{r}

dlt1_ties <- read_csv("data/dlt1-edges.csv", 
                      col_types = cols(Sender = col_character(), 
                                       Receiver = col_character(), 
                                       `Category Text` = col_skip(), 
                                       `Comment ID` = col_character(), 
                                       `Discussion ID` = col_character())) |>
  clean_names()


dlt1_actors <- read_csv("data/dlt1-nodes.csv", 
                   col_types = cols(UID = col_character(), 
                                    Facilitator = col_character(),
                                    expert = col_character(), 
                                    connect = col_character())) |>
  select(UID,region) |> 
  clean_names()

dlt1_network <- tbl_graph(edges = dlt1_ties,
                          nodes = dlt1_actors,
                          node_key = "uid",
                          directed = TRUE)

dlt1_network <- dlt1_network |>
  activate(nodes) |>
  mutate(out_degree = centrality_degree(mode = "out"))

ggraph(dlt1_network) +
  geom_edge_link(alpha = .1) +
  geom_node_point(aes(size = out_degree, color = region)) +
    scale_color_brewer(type = "qual", palette = "Set1") +
  theme_graph()


```