class: title-slide middle center inverse # Network Analysis in R ### David Schoch <img src="figures/Rlogo.png" height="400px"> .date[methods@manchester — Summer School] --- layout: true <div class="logo-header"></div> --- # why R? (and why not?) </br> ✔️ **R and its packages are open source** ✔️ **R is cross-platform** ✔️ **R can import/export any form of data** ✔️ **new methods available through packages** ✔️ **call R from pajek and visone** ✔️ **more than just SNA** -- </br> ❌ **it is not point-and-click** (which actually is a good thing) ❌ **slow-ish** (check for packages implemented in C++) ❌ **visualising networks is hard** (not anymore...🤯) --- # R packages for network analysis 622 packages depending on `igraph`, `graph`, and `network` (July 2019) .center[ <img src="figures/dependencies.png" height=550> ] --- # most important packages **igraph** (data structure, static network analysis) very fast! **statnet** (statistical modeling, dynamic network analysis) includes `sna`, `ergm` and `network` **intergraph** convert between `network` and `igraph` **RSiena** (stochastic actor oriented models) longitudinal network analysis of panel data **ggraph** (network visualization) "ggplot for networks" `graphlayouts` for nicer layouts **tidygraph** "tidyverse for networks" not covered in this workshop --- # packages for specific network types and tasks **multinet** Analysis and Mining of Multilayer Social Networks **bipartite** Analysis of two-mode networks (focus on ecology) **egor** ego network analysis **blockmodeling** Generalized blockmodeling for valued networks **signed networks** non so far --- # igraph or sna? **sna**: more "real" SNA methods **igraph**: faster and imported more often <img src="figures/runtimeBC.png" height=300> --- # getting help - `?function` - `vignette(package="netrankr")` - `vignette("neighborhood_inclusion",package="netrankr")` - `#rstats` - `https://cran.r-project.org/package=packagename` - look for `github` packages - `r-bloggers.com` - `https://masalmon.eu/2018/07/22/wheretogethelp/` --- .center[ <img src="https://boyter.org/static/books/Cf7eHZ1W4AEeZJA.jpg" height=600px> ] --- .center[ <img src="https://i.pinimg.com/originals/57/da/05/57da05590944ca168831d6c12aaebe60.jpg" height=600px>] --- .center[ <img src="https://i.pinimg.com/originals/53/be/34/53be34c987b10821f7c10b9d88436b92.jpg" height=600px>]