Creating a dynamic force network with the visNetwork package
The visNetwork
package is one among the most popular packages in the R community, mainly because it lets you display networks and interact with them without having to invest too much time.
This recipe will get you up and running with this package, showing you all that you need to know to start exploring your network in a fully interactive way.
Getting ready
In order to get started with this recipe, you will need to install and load the visNetwork
package to actually produce your network visualizations.
We will also use the jsonlite
package to parse the dataset we will use from the JSON format to the data frame:
install.packages(c("visnetwork","jsonlite")) library(visnetwork) library(jsonlite)
How to do it...
- Download the dataset from the Web and assign it to the
Energy
object:URL <- paste0("https://cdn.rawgit.com/christophergandrud/networkD3/", "master/JSONdata/energy.json") Energy <- jsonlite...