Skip to content

Instantly share code, notes, and snippets.

@jfaganUK
Created October 23, 2017 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfaganUK/1e494bec4a39858ba0abe51fc0f79251 to your computer and use it in GitHub Desktop.
Save jfaganUK/1e494bec4a39858ba0abe51fc0f79251 to your computer and use it in GitHub Desktop.
Lists of iGraph Networks
library(dplyr)
library(igraph)
clean_graph <- function(teamID, el) {
e <- el %>% filter(id == teamID) %>%
select(source, target)
g <- graph_from_data_frame(e) %>%
as.undirected(mode = 'collapse', edge.attr.comb = 'max') %>%
simplify
return(g)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment