Installing statnet
Technically statnet
is a suite of R packages that perform a wide range of data management, visualization, descriptive and statistical network analysis tasks. The number of packages in the suite is continuing to grow, providing access to new methodology as we develop it.
All statnet packages are downloaded/installed through the R
interface, so you’ll need to download and launch R
first.
There are two basic approaches to installing the statnet
software:
-
Install the
statnet
R meta-package: This provides a simple one-step approach to installing the core packages in the statnet suite, and their dependencies. It is a convenient approach, especially for beginners. -
Install the individual packages directly, which will automatically install their dependencies. This is useful if you know you only need one package, and necessary for the packages not loaded by statnet.
You should pick the approach best suited to your needs.
Installing the statnet
meta-package
From the R
command line:
> install.packages("statnet")
This will download from CRAN and install in your RLibrary the key packages needed for cross-sectional and temporal network analysis: ergm
and tergm
and their dependencies. If you want to find out where the RLibrary folder is on your system, type:
> .libPaths()
You will then need to type:
> library(statnet)
to use the packages in R
.
To determine which of the statnet
packages this process obtains, you can either check your session info with the command:
> sessionInfo()
or you can visit the statnet package page on CRAN and check the different lists; packages on the “Suggests” list are not automatically obtained through this method. To get one of them, follow the insturctions below.
Installing individual packages from the statnet
suite
We’ll use the package ergm
as an example here. From the R
command line:
install.packages("ergm")
This will download from CRAN and install in your RLibrary the ergm
package, as well as the other packages that ergm
depends on: network
, statnet.common
and RLE
.
You will then need to type:
library(ergm)
to use the packages in R
.
You can check the version with:
packageVersion("ergm")