simpleNetwork
creates simple D3 JavaScript force directed network
graphs.simpleNetwork(Data, Source = NULL, Target = NULL, height = NULL,
width = NULL, linkDistance = 50, charge = -200, fontSize = 7,
linkColour = "#666", nodeColour = "#3182bd",
nodeClickColour = "#E34A33", textColour = "#3182bd", opacity = 0.6)
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.NULL
then height is automatically determined based on context)NULL
then width is automatically determined based on context)# 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
simpleNetwork(NetworkData)
Run the code above in your browser using DataLab