View source: R/check.ErgmTerm.R
check.ErgmTerm | R Documentation |
Helper functions for implementing ergm()
terms, to check whether the term can be used with the specified
network. For information on ergm terms, see
ergmTerm
. ergm.checkargs
,
ergm.checkbipartite
, and ergm.checkderected
are
helper functions for an old API and are deprecated. Use
check.ErgmTerm
.
check.ErgmTerm(
nw,
arglist,
directed = NULL,
bipartite = NULL,
nonnegative = FALSE,
varnames = NULL,
vartypes = NULL,
defaultvalues = list(),
required = NULL,
dep.inform = rep(FALSE, length(required)),
dep.warn = rep(FALSE, length(required)),
argexpr = NULL
)
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 ( |
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 |
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 |
argexpr |
optional call typically obtained by calling
|
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.
As a convenience, if an argument is optional and its
default is NULL
, then NULL
is assumed to be an acceptable
argument type as well.
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. If argexpr=
argument is
provided, attr(,"exprs")
attribute is also returned, containing
expressions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.