Skip to content
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

Error for plot_multiplex3D #33

Open
Patrick-Wen opened this issue Aug 31, 2023 · 3 comments
Open

Error for plot_multiplex3D #33

Patrick-Wen opened this issue Aug 31, 2023 · 3 comments

Comments

@Patrick-Wen
Copy link

Patrick-Wen commented Aug 31, 2023

I followed the tutorial for "Multilayer community detection" (.../Documents/GitHub/muxViz/docs/articles/ml_community.html) but got an error when running

# Show the multiplex network
plot_multiplex3D(g.list, layer.layout=lay, layer.colors=layer.colors,
                         layer.shift.x=0.5, layer.space=2,
                         layer.labels="auto", layer.labels.cex=1.5,
                         node.size.values="auto", node.size.scale=0.8,
                         show.aggregate=T)

Here is the error message:
Error in !is.na(layer.labels) && !is.null(layer.labels) :
'length = 3' in coercion to 'logical(1)'

> !is.na(layer.labels)
[1] TRUE TRUE TRUE
> !is.null(layer.labels)
[1] TRUE

The first line returns 3 TRUE while the second only 1, so when using &&, an error is returned. This seems to be an inherent error in the source code. I suspect this issue should be resolved internally. Please let me know if I am wrong.

@Patrick-Wen
Copy link
Author

There is the same issue with the line !is.na(layer.labels) && !is.null(layer.labels). I modified both lines of code and the tutorial example got running successfully to retun the stacked 3D multilayer graph.

@drorkenett
Copy link

drorkenett commented Aug 31, 2023 via email

@Patrick-Wen
Copy link
Author

Patrick-Wen commented Aug 31, 2023

I did not formally correct the code, I just deleted the two aforementioned lines (i.e., !is.na(layer.labels) && !is.null(layer.labels) and !is.na(layer.labels) && !is.null(layer.labels) ) and the associated if statement to require the code specified in the if statement to be run directly without being checked. This is suitable for running the example in the tutorial since the condition specified by the if statement is satisfied. Certainly, a more general approach is to update the if statement rather than simply delete it.

I downloaded the zip file from GitHub, unzip the folder, find the function plot_multiplex3D in "...\muxViz-master\R\muxLib_plot_functions.R", and deleted the corresponding lines. Then I compressed the modified package to a new zip file, and use devtools::install_local("") to install this package. Then run the code in the tutorial, that worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants