19 November 2015
New workplace, large college, no idea of who knows whom.
Solution…some kind of network-y “Rolodex”?
library(igraph) library(networkD3) # the library formerly known as "d3Network"
Two columns of people: 1) a team member 2) a “Rolodex” contact
Additional columns with attributes:
Read in the .CSV…
raw_csv_data <- read.csv("TEL Network Map - Spring 2015.csv", header=TRUE) names(raw_csv_data) <- c('TELmember', 'CLAcontact', 'dept', 'context', 'notes', 'strength') #head(raw_csv_data)
We're in luck! The iGraph package's “graph_from_data_frame” takes as an argument…
“A data frame containing a symbolic edge list in the first two columns. Additional columns are considered as edge attributes. Since version 0.7 this argument is coerced to a data frame with as.data.frame.”
So, let's convert to an iGraph-friendly data format…
network_graph_data <- graph_from_data_frame(raw_csv_data, directed=FALSE)
Note: This is the simplest way to coerce our data into an iGraph-friendly format. It will treat all columns as edge attributes–something we may or may not want. For a more complicated version that supports vertex attributes, as well, look at the
Look at the vertices…
Look at the edges…