I would like to replace the basic node image to a custom jpg in networkD3 package in R.
Here is an example:
library(networkD3)
# Load data
data(MisLinks)
data(MisNodes)
# Plot
forceNetwork(Links = MisLinks, Nodes = MisNodes,
Source = "source", Target = "target",
Value = "value", NodeID = "name",
Group = "group", opacity = 0.8)
So I would like to create a node like this:
Instead of this:
Is it possible?
I would like to replace the basic node image to a custom jpg in networkD3 package in R. [...] For me it is also good with any other interacive R network package
For example, you could do
library(networkD3)
library(visNetwork)
library(dplyr)
data(MisLinks)
data(MisNodes)
visNetwork(
MisNodes %>%
rename("label"=name) %>%
mutate(id = seq_len(nrow(MisNodes))-1),
MisLinks %>%
rename("from"=source, "to"=target)
) %>%
visNodes(
shape = "image",
image = "http://cdn0.iconfinder.com/data/icons/octicons/1024/mark-github-128.png"
)
giving you