View source: R/community_names.R
community_names | R Documentation |
A function to give to a community the name of its node with the highest chosen measure. It also gives the edges the name of their community. If the edge connects nodes from different community, name will be NA.
The function takes into account the parameters chosen for the leiden_improved()
function.
If you have chosen 2 or 3 levels of resolution, it repeats the same process for the second and third resolution.
In other words, for 3 levels of resolution, you will have the names of the communities for the first value of the
Leiden resolution, but also the names for the second and third values.
community_names( graph, ordering_column, naming = "Label", community_column = "Com_ID" )
graph |
A tidygraph object. |
ordering_column |
Enter the name of the column you want to be used to choose the community name. For instance, if
you choose |
naming |
Enter the name of the column you want to be used for naming the community. The function takes the node
with the highest |
community_column |
The name of your community identifiers column. |
The attribute of nodes and edges with the names of the communities is called
Community_name
. It is formed by the identifier of the community (in the Com_ID
column)
and by the naming
value.
If you have entered a second and a third resolutions values in the
leiden_improved()
function, you will have two supplementary columns: Community_2_name
and Community_3_name
.
The same graph object but with a column Community_name
, as well as Community_2_name
and Community_3_name
if you have run the leiden_workflow()
function for more than one resolution.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.