Click to show/hide the code
pacman::p_load(igraph, tidygraph, ggraph, visNetwork, lubridate, clock, tidyverse, graphlayouts, jsonlite)Lim Li Ying
May 13, 2023
---
title: "In-class Exercise 5"
author: "Lim Li Ying"
date: "13 May 2023"
edit: visual
execute:
warning: false
---
# Getting started
## Installing and loading R packages
```{r}
pacman::p_load(igraph, tidygraph, ggraph, visNetwork, lubridate, clock, tidyverse, graphlayouts, jsonlite)
```
## Loading the data set
```{r}
MC1 <- jsonlite::fromJSON("data/MC1.json")
```
```{r}
MC1_nodes <- as_tibble(MC1$nodes) %>%
select(id, type, country)
```
```{r}
MC1_edges <- as_tibble(MC1$links) %>%
select(source, target, type, weight, key)
```