So, I wanted to see if I could construct a network diagram of the discussions in one of my subjects. After a bit of fielding, I managed to do exactly that.
Discussion_1_edges <- read_excel("Discussion_1_edges.xlsx") Discussion_1_nodes <- read_excel("Discussion_1_nodes.xlsx") nodes <- Discussion_1_nodes edges <- Discussion_1_edges ### igraph only takes matrices. Need to convert frist to a matrix. edges_new <- select(edges, "From Name", "To Name") edges_new <- as.matrix(edges_new) ### Now make it a network object. discussion_1_network <- graph.edgelist(edges_new, directed = TRUE) discussion_1_network plot(discussion_1_network) plot(discussion_1_network, vertex.size = 10) plot(discussion_1_network, vertex.size = 10, vertex.color = "tomato", vertex.frame.color = NA) plot(discussion_1_network, vertex.size = 10, vertex.color = "tomato", vertex.frame.color = NA, vertex.label.cex = .7, vertex.label.color = "black") plot(discussion_1_network, vertex.size = 10, vertex.color = "tomato", vertex.frame.color = NA, vertex.label.cex = .7, vertex.label = NA, edge.curved = .1, edge.arrow.size = .3, edge.width = .7) # Load in the edge list again library(readxl) Discussion_1_edges <- read_excel("Discussion_1_edges.xlsx") # Load in the attributes again Discussion_1_attributes <- read_excel("Discussion_1_attributes.xlsx") # Put them both in the network. discussion_1_network <- graph_from_data_frame(Discussion_1_edges, directed = T, vertices = Discussion_1_attributes) discussion_1_network V(discussion_1_network)$Role V(discussion_1_network)$color <- ifelse(V(discussion_1_network)$Role == "Teacher", "dodgerblue3","seagreen") plot(discussion_1_network, vertex.size = 10, vertex.frame.color = "black", vertex.label.cex = .7, vertex.label = NA, edge.curved = .1, edge.arrow.size = .3)