autograph

autograph logo

Lifecycle: maturing CRAN/METACRAN GitHub release (latest by date) GitHub Release Date Codecov test coverage

About the package

This package aims to make exploration, analysis, and publication of results from any of the stocnet packages easier, faster, and more consistent. It does this by letting you simply set a theme, say for your institution, and then those palettes will be used whenever you use plot() or graphr() on an object created in one of the relevant packages.

Setting a theme

It is very easy to set a theme. Just type stocnet_theme() to see which is the theme currently set, and to get a list of available themes. Then enter the chosen theme name in

library(autograph)
library(patchwork)
stocnet_theme()
#> ℹ Theme is set to default.
#> ℹ The following themes are available: default, bw, iheid, ethz, uzh, rug, unibe, crisp, neon, and rainbow.
(plot(node_degree(ison_karateka)) + 
plot(tie_betweenness(ison_karateka)))/
(plot(node_in_regular(ison_southern_women, "e")) + 
plot(as_matrix(ison_southern_women),
     membership = node_in_regular(ison_southern_women, "e")))

Themed figures

stocnet_theme("ethz")
#> ✔ Theme set to ethz.
(plot(node_degree(ison_karateka)) + 
plot(tie_betweenness(ison_karateka)))/
(plot(node_in_regular(ison_southern_women, "e")) + 
plot(as_matrix(ison_southern_women),
     membership = node_in_regular(ison_southern_women, "e")))

Themed figures

Mapping

{autograph} includes three one-line graphing functions with sensible defaults based on the network’s properties.

graphr

First, graphr() is used to graph networks in any of the {manynet} formats. It includes sensible defaults so that researchers can view their network’s structure or distribution quickly with a minimum of fuss. Compare the output from {autograph} with a similar default from {igraph}:

Example illustrating differences in default igraph and autograph graphs

Here the {autograph} function recognises that the network is a two-mode network and uses a bipartite layout by default, and recognises that the network contains names for the nodes and prints them vertically so that they are legible in this layout. Other ‘clever’ features include automatic node sizing and more. By contrast, {igraph} requires the bipartite layout to be specified, has cumbersome node size defaults for all but the smallest graphs, and labels also very often need resizing and adjustment to avoid overlap. All of {autograph}’s adjustments can be overridden, however…

More options

Changing the size and colors of nodes and ties is as easy as specifying the function’s relevant argument with a replacement, or indicating from which attribute it should inherit this information.

Graph illustrating automatic and manual use of node color and size

More layouts

{autograph} can use all the layout algorithms offered by packages such as {igraph}, {ggraph}, and {graphlayouts}, and offers some additional layout algorithms for snapping layouts to a grid, visualising partitions horizontally, vertically, or concentrically, or conforming to configurational coordinates.

Graphs illustrating different layouts

graphs

Second, graphs() is used to graph multiple networks together, which can be useful for ego networks or network panels. {patchwork} is used to help arrange individual plots together.

Example of graphs() used on longitudinal data

grapht

Third, grapht() is used to visualise dynamic networks. It uses {gganimate} and {gifski} to create a gif that visualises network changes over time. It really couldn’t be easier.

Example of grapht() on longitudinal data

Installation

Stable

The easiest way to install the latest stable version of {autograph} is via CRAN. Simply open the R console and enter:

install.packages('autograph')

library(autograph) will then load the package and make the data and tutorials (see below) contained within the package available.

Development

For the latest development version, for slightly earlier access to new features or for testing, you may wish to download and install the binaries from Github or install from source locally. The latest binary releases for all major OSes – Windows, Mac, and Linux – can be found here. Download the appropriate binary for your operating system, and install using an adapted version of the following commands:

To install from source the latest main version of {autograph} from Github, please install the {remotes} package from CRAN and then:

Other sources

Those using Mac computers may also install using Macports:

sudo port install R-autograph

Funding details

Development on this package has been funded by the Swiss National Science Foundation (SNSF) Grant Number 188976: “Power and Networks and the Rate of Change in Institutional Complexes” (PANARCHIC).

mirror server hosted at Truenetwork, Russian Federation.