Jsonlite

Author

Dabbie Neo

Published

May 13, 2023

Modified

June 4, 2023

pacman::p_load(jsonlite,tidygraph,ggraph,visNetwork,tidyverse)
MC1 <- jsonlite::fromJSON("data/MC1.json")
#Extract id, type and country and make it as a tibble database. use select to choose the fields you want and reorganise the data as you want
MC1_nodes <- as_tibble(MC1$nodes) %>%
  select(id, type, country)
MC1_edges <- as_tibble(MC1$links) %>%
  select(source, target, type, weight, key)