knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" )
multinets
is an R package that provides tools to visualize and analyze Multilevel Network Data. It was built as an extension to the igraph
package.
The multinets
package is on CRAN. It is developed under control version using Git and is hosted in GitHub. You can download it from CRAN using:
install.packages("multinets")
You can download the development version from GitHub using devtools
:
# install.packages("devtools") devtools::install_github("neylsoncrepalde/multinets")
As a basic example, we will plot a multilevel network. We are going to use linked_sim
, a simulated multilevel network dataset.
library(igraph) library(multinets) # Load the dataset data("linked_sim") # Test if the data is a multilevel network is_multilevel(linked_sim) # Set the layout coordinates l <- layout_multilevel(linked_sim, layout = layout_with_kk) # Set different colors and shapes for each level vertices linked_sim <- set_color_multilevel(linked_sim) linked_sim <- set_shape_multilevel(linked_sim) # Plot plot(linked_sim, layout = l, vertex.size = 5, vertex.label = NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.