Introduction

The notion of spreading activation is a prevalent metaphor in the cognitive sciences; however, the tools to implement spreading activation in a computational simulation are not as readily available. This vignette introduces the spreadr R package (pronunced ‘SPREAD-er’), which can implement spreading activation within a specified network structure. The algorithmic method implemented in the spreadr function follows the approach described in Vitevitch, Ercal, and Adagarla (2011), who viewed activation as a fixed cognitive resource that could “spread” among connected nodes in a network.

Installation

You can choose to install the stable version from CRAN, or the development build from GitHub.

Stable (CRAN)

install.packages("spreadr")

If you encounter any bugs or issues, please try the development build first. The bug or issue may have already been fixed on GitHub, but not yet propagated onto CRAN.

Development (GitHub)

install.packages("remotes")
remotes::install_github("csqsiew/spreadr")

If you encounter any bugs or issues, please try the development build first. The bug or issue may have already been fixed on GitHub, but not yet propagated onto CRAN.

Example with a phonological network

In this example, we will simulate spreading activation in a small sample portion of a phonological network (Chan and Vitevitch 2009) which is automatically loaded with spreadr. This phonological network is unweighted and undirected, but spreadr supports weighted and directed graphs as well. This makes it is possible to simulate spreading activation in a weighted network where more activation is passed between nodes that have “stronger” edges, or in a directed (asymmetric) network where activation can pass from node i to node j but not necessarily from node j to node i.

You may substitute any network in place of this example one.

Describe the network

The network for spreading activation must be either an igraph object or an adjacency matrix.

Using an igraph object

pnet, an igraph object with named vertices representing our sample phonological network is automatically loaded with the spreadr library.

library(spreadr)
## Warning: package 'Rcpp' was built under R version 4.0.2
library(igraph)
## Warning: package 'igraph' was built under R version 4.0.2
data("pnet")  # load and inspect the igraph object
plot(pnet)