-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
68 lines (46 loc) · 2.15 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: "multinets: Multilevel Network Analysis"
output: github_document
---
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![Build Status](https://travis-ci.org/neylsoncrepalde/multinets.svg?branch=master)](https://travis-ci.org/neylsoncrepalde/multinets)
---
[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.4.0-6666ff.svg)](https://cran.r-project.org/)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/multinets)](https://cran.r-project.org/package=multinets)
```{r setup, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
<!-- README.md is generated from README.Rmd. Please edit that file -->
`multinets` is an R package that provides tools to visualize and analyze Multilevel Network Data. It was built as an extension to the [`igraph`](http://igraph.org/r/) package.
## Installation
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:
```{r install_cran, eval=FALSE}
install.packages("multinets")
```
You can download the development version from GitHub using `devtools`:
```{r install, eval=FALSE}
# install.packages("devtools")
devtools::install_github("neylsoncrepalde/multinets")
```
## Usage
As a basic example, we will plot a multilevel network. We are going to use `linked_sim`, a simulated multilevel network dataset.
```{r example, fig.width=8, fig.height=7}
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)
```