# Core-periphery in a simple network
adj <- matrix(c(
0, 1, 1, 1, 0,
1, 0, 1, 1, 0,
1, 1, 0, 1, 1,
1, 1, 1, 0, 1,
0, 0, 1, 1, 0
), 5, 5)
rownames(adj) <- colnames(adj) <- LETTERS[1:5]
cp <- cograph::core_periphery(adj)
cp
# Discrete assignment
cp_disc <- cograph::core_periphery(adj, method = "discrete")
cp_disc
Run the code above in your browser using DataLab