0

I've read the documentation in https://christophergandrud.github.io/networkD3/ and managed to do the forceNetwork() graph.

But how could i set "weight" on the circles?

For example, if someone has more links, it's circle would be bigger.

The graph i managed to plot kept all the circles with the same size.

CJ Yetman
  • 8,373
  • 2
  • 24
  • 56
Lucca Ramalho
  • 573
  • 1
  • 6
  • 16

1 Answers1

0

Use the Nodesize parameter of the forceNetwork function to refer to the name of the column in your Nodes data frame that contains numeric values which will be used to determine the size of each node. For example...

forceNetwork(Links = networkData, Nodes = nodes, Source = "src", Target = "target", NodeID = "name", Group = "group", Nodesize = "node_size")

The help file says "Nodesize: character string specifying the a column in the Nodes data frame with some value to vary the node radius's with. See also radiusCalculation."

CJ Yetman
  • 8,373
  • 2
  • 24
  • 56