---
title: "ERGM terms cross-reference"
author: "statnet.org"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
  %\VignetteIndexEntry{ERGM terms cross-reference}
---
<style type="text/css">
table, td, th {
  border: 1px solid #cccccc;
  padding: 8px;
}
</style>

This document is an automatically generated cross reference for the ergm model terms from the [stanet project](https://statnet.org).  The source for this data and additional descriptions are in the `?ergm.terms` help file or the [ergm manual](https://cran.r-project.org/package=ergm). 


```{r, include=FALSE}
library(ergm)
```

## Interactive searching

It is possible to search the `ergm` terms help page and search for specific keywords of terms using the `search.ergmTerms` command.  For example to find all the terms that mention 'triangle' in their description:

```{r}
search.ergmTerms(search='triangle')
```

Or to find all of the dyad-independent bipartite terms:

```{r}
search.ergmTerms(keywords=c('bipartite','dyad-independent'))
```


## Basic / Frequently-used term keyword matrix

For convenience, this table lists a subset of the most commonly-used ergm terms and keywords.

```{r,results='asis',echo=FALSE}
ergm:::.formatMatrixHtml(ergm:::.termMatrix('ergmTerm', keywords=~"frequently-used"%in%., display.keywords = subset(ergm::ergm_keyword(), popular)$name), wrapRdTags=FALSE)
```

For convenience, this table lists operator terms: terms that wrap or modify other terms.

```{r,results='asis',echo=FALSE}
ergm:::.formatMatrixHtml(ergm:::.termMatrix('ergmTerm', keywords=~"operator"%in%., display.keywords = subset(ergm::ergm_keyword(), popular & name!="operator")$name), wrapRdTags=FALSE)
```


## Complete term keyword matrix
This table lists the complete set of terms available in the ergm package. In HTML versions, clicking on a term name will jump to its definition. 

```{r,results='asis',echo=FALSE}
ergm:::.formatMatrixHtml(ergm:::.termMatrix('ergmTerm'), wrapRdTags=FALSE)
```


## Term definitions table

This table lists full definitions for all of the terms along with their tags.  Note that some terms may have multiple versions (e.g. valued vs. binary) with slightly different arguments and will be listed more than once with the same definition. 

```{r,results='asis',echo=FALSE}
terms<-ergm:::ergmTermCache('ergmTerm')
ergm:::.termTable(terms)
```

## Term index by keyword

Note that currently the keywords are somewhat ambiguous in their exclusivity.  For example, a term marked as 'directed' can not be used with an undirected network, but a term not marked with either 'directed' or 'undirected' can be used with both. (rename to 'directed-only' ?)

```{r,results='asis',echo=FALSE}
cat(ergm:::.formatTocHtml(ergm:::.termToc('ergmTerm'), wrapRdTags=FALSE))
```

------------

This documentation was built with..
```{r}
sessionInfo()
```
