linking a node in networkD3 to a website using clickAction = NULL
Is there a way to use a node as a link to an external website using the function forceNetwork() in the networkD3 package in r ? I was thinking maybe modifying the clickAction ? Example data: library(networkD3) data(MisLinks) data(MisNodes) # Create a random URL in the nodes dataset MisNodes$URL <- paste0("http://www.RANDOMLINK_", sample(1:100, NROW(MisNodes)), ".com") head(MisNodes) MyClickScript <- 'alert(d.index)' forceNetwork(Links = MisLinks, Nodes = MisNodes, Source = "source", Target = "target", Value = "value", NodeID = "name", Group = "group", opacity = 0.8, clickAction = MyClickScript