2

I've tried to use with the follwing data:

> head(network)
   source target
1      1      1
2      1      4
3      1     11
4      1     12
5      1     23
6      1     41


> head(no)
         no group
1    AL USA     1
2    AR USA     1
3 Argentina     1
4 Australia     1
5 AUSTRALIA     1
6   Austria     1

and code:

forceNetwork(Links = network, Nodes = no, NodeID = "no",
         Source = "source", Target = "target", 
         Group = "group", opacity = 0.8)

My problem is nothing happens. :( No error message...the viewer screen just stays white?

Any Ideas?

Cheers, Cliff


simpleNetwork(network)

works by the way.

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

2 Answers2

0

source and target should be numeric vectors, giving the index of the node in your nodes data frame (0 indexed).

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

I've found the answer here: Going crazy with forceNetwork in R: no edges displayed

My data had to be 0-based instead of 1-based.