-
Notifications
You must be signed in to change notification settings - Fork 47
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
robustness function, random error #25
Comments
When |
Hello everyone! robustness(net_joint, type=c("vertex"), measure=c("random")) but the error is always: Error in { : task 3 failed - "Invalid vertex names" as that reported by @mmpust !!
IGRAPH 41f50f0 UNW- 108 160 --
I really thank anyone could help me!! |
I was not able to solve the problem, even though the vertexes in my network have unique names. |
If one or both of you could send me (via emai if you prefer) the graph that is causing errors (as a |
@martaesse I am not sure why you would see an error. Your post shows that your graph has names, but the graph you sent me is unnamed (they are just numbers); however, when I assign the same names I am still able to run the function. Are you running on Windows, by chance? Please provide some system information, including the version of |
Thank you @cwatson. I'm sorry I sent you a graph with different names from one in the post: this is because I did a lot of tests changing the names of the nodes, hoping that the error was in the type of name assigned, i.e. whether it was a number or a string. While the robustness command with the "degree" and "betweenness" option always works, the "random" one never does. (Robustness also works by removing edges randomly). Anyway, yes I use windows (Windows 10 Pro, version 20H2. 64-bit Operating System). Brain Graph is 3.0.0 version and R version 4.0.4. I really thank you for the help you are giving me. |
I see. My first recommendation would be to use a Linux system, as I have seen more Out of curiosity, do you also see an error when you do A quick fix you could try would be to assign vertex names using one of the atlases in |
I really thank you. |
Hi, Christopher, I have the same issue even when I running the code on Linux.
Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): My object is very simply as below and does have names for each vertex.
However, i can't go through to get the random estimation
Could you please have a look and give solution? Thank you, |
Greetings, |
Sorry for such a late response. I can replicate the error with some data provided by another user, so I'll have to work on an update that avoids using the vertex names. It does not appear to be a Windows issue, nor is it a R v3.x vs. v4.x issue. I'll try to get a bugfix update in the next few weeks. |
Hello, I also exprience this problem, when I use "vertext" type and "random" measure. |
Yes, I'll have to keep working on it. Sorry for such a long delay. |
Hello, I think I figured out what the issue was. I believe when it was going through the second loop it was deleting the vertices from the graph and when it tried to run the loop for the second time the graph (g) had no vertices since they were previously deleted and that is why it had the error. if (type == 'vertex') {
if (measure == 'random') {
max.comp <- foreach(i=seq_len(N), .combine='cbind') %dopar% {
ord <- V(g)$name[index[, i]]
tmp <- rep.int(orig_max, n)
for (j in seq_len(n - 1L)) {
g <- delete_vertices(g, ord[j]) #this specifically was causing the error i believe
tmp[j + 1L] <- max(components(g)$csize)
}
tmp
}
max.comp.removed <- rowMeans(max.comp)
} I fixed it by changing it by changing that piece of code to: if (type == 'vertex') {
if (measure == 'random') {
max.comp <- foreach(i=seq_len(N), .combine='cbind') %dopar% {
ord <- igraph::V(g)$name[index[, i]]
tmp <- rep.int(orig_max, n)
g.new <- g # added line
for (j in seq_len(n - 1L)) {
g.new <- igraph::delete_vertices(g.new, ord[j]) #updated line
tmp[j + 1L] <- max(igraph::components(g.new)$csize) # updated line
}
tmp
}
max.comp.removed <- rowMeans(max.comp)
} Hope this helps and thank you for this wonderful package! |
Thank you for providing this nice R package. I want to calculate my network (igraph) robustness and vulnerability. When I run the robustness function with degree and betweeness centrality measures, it does run fine. However, for the random argument, I always get the following error message:
Error in { : task 3 failed - "Invalid vertex names"
Any ideas on how to solve the problem? Why is it just a problem with "random" and not the other two arguments? Thank you!
The text was updated successfully, but these errors were encountered: