neylsoncrepalde / multinets

Multilevel Network Analysis
GNU General Public License v3.0
19 stars 2 forks source link

Could not set color for different edges. #3

Closed hope-data-science closed 4 years ago

hope-data-science commented 4 years ago

I just use the example you present at README.md and I find it didn't work for the colors. The output is listed as below:

library(igraph)

>

> Attaching package: 'igraph'

> The following objects are masked from 'package:stats':

>

> decompose, spectrum

> The following object is masked from 'package:base':

>

> union

library(multinets)

> multinets was developed by Neylson Crepalde as an extension to 'igraph'

Load the dataset

data("linked_sim")

Test if the data is a multilevel network

is_multilevel(linked_sim) [1] TRUE

> [1] TRUE

Set the layout coordinates

l <- layout_multilevel(linked_sim, layout = layout_with_kk)

Set different colors and shapes for each level vertices

linked_sim <- set_color_multilevel(linked_sim) Warning message: In length(eattrs[[name]]) <- ec : length of NULL cannot be changed linked_sim <- set_shape_multilevel(linked_sim)

Plot

plot(linked_sim, layout = l, vertex.size = 5, vertex.label = NA)

Thank you.

neylsoncrepalde commented 4 years ago

Hello!

I tried to reproduce your error but I could not. Everything worked just fine for me. Could you post here multinets version, please?

Anyway, I think this problem has been fixed in the last update (which took place two or three days ago). Please, update multinets and igraph.