title: Setting networkD3 Node Size with vector of weights
body: <p>I'm trying to use <code>data.tree</code> and <code>NetworkD3</code> in R to create a tree representation of a file system where the nodes of the graph are weighted by file size.</p>
  
  <pre><code>library(data.tree)
  library(networkD3)
  
  repo &lt;- Node$new("Repository")
  git &lt;- repo$AddChild(".git")
  prod &lt;- repo$AddChild("Production")
  exp &lt;- repo$AddChild("Experimental")
  
  repo$size &lt;- 866000
  git$size &lt;- 661000
  prod$size &lt;- 153000
  exp$size &lt;- 48000
  </code></pre>
  
  <p>I can get a vector of these sizes using Get, so that</p>
  
  <pre><code>sizes &lt;- repo$Get("size")
  </code></pre>
  
  <p>But when I try to put it all together, I'm not sure how to include this weight information in the network visualization step. Trying to do something like this... </p>
  
  <pre><code>reponet &lt;- ToDataFrameNetwork(repo,"repo")
  net &lt;- forceNetwork(reponet, Nodesize = repo$Get("size"))
  </code></pre>
  
  <p>to no avail. Basically I'm trying to do what Julia Silge did in this great <a href="https://stackoverflow.blog/2017/10/03/mapping-ecosystems-software-development/">SO blog post</a>. Does anyone know how to set this?</p>