Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

check.ErgmTerm

Ensures an Ergm Term and its Arguments Meet Appropriate Conditions


Description

Helper functions for implementing ergm() terms, to check whether the term can be used with the specified network. For information on ergm terms, see ergm-terms. ergm.checkargs, ergm.checkbipartite, and ergm.checkderected are helper functions for an old API and are deprecated. Use check.ErgmTerm.

Usage

check.ErgmTerm(
  nw,
  arglist,
  directed = NULL,
  bipartite = NULL,
  nonnegative = FALSE,
  varnames = NULL,
  vartypes = NULL,
  defaultvalues = list(),
  required = NULL,
  response = NULL,
  dep.inform = rep(FALSE, length(required)),
  dep.warn = rep(FALSE, length(required))
)

Arguments

nw

the network that term X is being checked against

arglist

the list of arguments for term X

directed

logical, whether term X requires a directed network; default=NULL

bipartite

whether term X requires a bipartite network (T or F); default=NULL

nonnegative

whether term X requires a network with only nonnegative weights; default=FALSE

varnames

the vector of names of the possible arguments for term X; default=NULL

vartypes

the vector of types of the possible arguments for term X, separated by commas; an empty string ("") or NA disables the check for that argument; default=NULL

defaultvalues

the list of default values for the possible arguments of term X; default=list()

required

the logical vector of whether each possible argument is required; default=NULL

response

Name of the edge attribute whose value is to be modeled in the valued ERGM framework. Defaults to NULL for simple presence or absence, modeled via a binary ERGM.

dep.inform, dep.warn

a list of length equal to the number of arguments the term can take; if the corresponding element of the list is not FALSE, a message() or a warning() respectively will be issued if the user tries to pass it; if the element is a character string, it will be used as a suggestion for replacement.

Details

The check.ErgmTerm function ensures for the InitErgmTerm.X function that the term X:

  • is applicable given the 'directed' and 'bipartite' attributes of the given network

  • is not applied to a directed bipartite network

  • has an appropiate number of arguments

  • has correct argument types if arguments where provided

  • has default values assigned if defaults are available

by halting execution if any of the first 3 criteria are not met.

Value

A list of the values for each possible argument of term X; user provided values are used when given, default values otherwise. The list also has an attr(,"missing") attribute containing a named logical vector indicating whether a particular argument had been set to its default.


ergm

Fit, Simulate and Diagnose Exponential-Family Models for Networks

v3.11.0
GPL-3 + file LICENSE
Authors
Mark S. Handcock [aut], David R. Hunter [aut], Carter T. Butts [aut], Steven M. Goodreau [aut], Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Martina Morris [aut], Li Wang [ctb], Kirk Li [ctb], Skye Bender-deMoll [ctb], Chad Klumb [ctb], Michał Bojanowski [ctb], Ben Bolker [ctb]
Initial release
2020-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.