d3SimpleNetwork
creates simple D3 JavaScript force
directed network graphs.d3SimpleNetwork(Data, Source = NULL, Target = NULL,
height = 600, width = 900, fontsize = 7,
linkDistance = 50, charge = -200, linkColour = "#666",
nodeColour = "#3182bd", nodeClickColour = "#E34A33",
textColour = "#3182bd", opacity = 0.6,
standAlone = TRUE, file = NULL, iframe = FALSE,
d3Script = "http://d3js.org/d3.v3.min.js")
Source = NULL
then
the first column of the data frame is treated as the
source.Target = NULL
then
the second column of the data frame is treated as the
target.file = NULL
then result is returned to the
console.iframe = TRUE
then the
graph is saved to an external file in the working
directory and an HTML iframe
linking to the file
is printed to the console. This is useful if you are
using Slidify and many other HTML # Fake data
Source <- c("A", "A", "A", "A", "B", "B", "C", "C", "D")
Target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I")
NetworkData <- data.frame(Source, Target)
# Create graph
d3SimpleNetwork(NetworkData, height = 300, width = 700,
fontsize = 15)
Run the code above in your browser using DataLab