To create a nested list of different lengths of type igraph.vs with different values of type integer, you can use the following code:
main.r577 chars28 lines
This code will create a dataframe df with two columns: id and group. The id column contains the vertex IDs from the graph, and the group column contains the corresponding group names.
If you want to assign different integer values to each vertex in the nested list, you can modify the code as follows:
main.r530 chars17 lines
This code will create a dataframe df with three columns: id, value, and group. The id column contains the vertex IDs from the graph, the value column contains the corresponding integer values, and the group column contains the corresponding group names.
gistlibby LogSnag