-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle issue #93 #94
handle issue #93 #94
Conversation
Quick update: just in case we reintroduce The protection looks like this for # prevent namespace conflict with igraph
if ("package:igraph" %in% search()) {
y = ifelse(is_dir == "digraph", "directed", "undirected")
z = c("indegree" = "in", "outdegree" = "out", "degree" = "all", "freeman" = "all")[ x ]
data$weight = igraph::degree(igraph::graph.adjacency(as.matrix(net), mode = y), mode = z)
} else {
data$weight = sna::degree(net, gmode = is_dir, cmode = ifelse(x == "degree", "freeman", x))
} The code does not even need to know if |
That's great! Can you share? I'll take a look and possibly integrate when I take a look at the whole thing.
|
The code is in my comment above. If This operation should never take too long except on very, very large graphs, and it should work fine on any binary one-mode adjacency matrix. P.S. |
Looks like a good solution to me! |
The problem remains that I do not know how to avoid conflicts with
igraph
. If the user loadsigraph
after loadingggnet
/ggnet2
/GGally
, then it's easy to get this error: