get_dice_similarity {DiagrammeR} | R Documentation |
Get the Dice similiarity coefficient scores for one or more nodes in a graph.
get_dice_similarity(graph, nodes = NULL, direction = "all", round_to = 3)
graph |
a graph object of class
|
nodes |
an optional vector of node IDs to consider for Dice similarity scores. If notsupplied, then similarity scores will be provided for every pair of nodes in the graph. |
direction |
using |
round_to |
the maximum number of decimal places
to retain for the Dice similarity coefficient
scores. The default value is |
a matrix with Dice similiarity values for each pair of nodes considered.
# Create a random graph graph <- create_random_graph( 10, 22, set_seed = 1) # Get the Dice similarity values for # nodes `5`, `6`, and `7` get_dice_similarity(graph, 5:7) #> 5 6 7 #> 5 1.000 0.444 0.667 #> 6 0.444 1.000 0.444 #> 7 0.667 0.444 1.000