christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
649 stars 270 forks source link

as_treenetdf() and treeNetwork() are not exported, but their help files are available #291

Closed maspotts closed 2 years ago

maspotts commented 2 years ago

I can't figure out why this is, but even when I install from github (networkD3_0.4.9000), I can't see as_treenetdf() or treeNetwork(), and yet I can bring up their help files: ie:

> library(networkD3)
> as_treenetdf()
Error in as_treenetdf() : could not find function "as_treenetdf"
> ?as_treenetdf
as_treenetdf             package:networkD3             R Documentation

Convert one of numerous data types to treeNetwork's 'native' treenetdf
form

Description:

     The ‘treeNetwork’ function uses a 'native' data format that
     consists of a data frame with minimally 2 vectors/columns, one
     named ‘'nodeId'’ and one named ‘'parentId'’. Other columns in the
     data frame are also passed on to the JavaScript code and attached
     to the elements in the D3 visualization so that they can
     potentially be accessed by other JavaScript functions. This is an
     advantageous format because:

Am I missing something obvious?

maspotts commented 2 years ago

I guess my R session must have been screwed up: I fixed my problem like this:

> detach("package:networkD3", unload = TRUE)
> devtools::install_github('christophergandrud/networkD3', force = TRUE)

Don't know why that was necessary. Closing on the assumption this was user error.