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

pending_update_network

A (Relatively) Lightweight Read-Only Representation of Network Objects


Description

pending_update_network is an semi-internal class for passing around results of MCMC sampling, particularly when the result is used to start another MCMC sampler. It is deliberately loosely specified, and its structure and even name are subject to change.

Usage

pending_update_network(
  nw,
  update = NULL,
  response = if (is.character(update)) update
)

is.pending_update_network(x)

## S3 method for class 'pending_update_network'
as.edgelist(x, ...)

## S3 method for class 'pending_update_network'
as.matrix(x, matrix.type = NULL, attrname = NULL, ...)

## S3 method for class 'pending_update_network'
as.network(x, ..., populate = TRUE)

## S3 method for class 'pending_update_network'
network.edgecount(x, na.omit = TRUE, ...)

## S3 method for class 'pending_update_network'
network.dyadcount(x, na.omit = TRUE, ...)

## S3 method for class 'pending_update_network'
network.size(x, ...)

## S3 method for class 'pending_update_network'
network.naedgecount(x, ...)

Arguments

nw

a network object.

update

a character string, a list with elements named "newnwtails", "newnwheads", and (optionally) "newnwweights", or "newedgelist", or NULL. See Details.

response, attrname

Name of edge attribute to get or set. If NULL, binary network is assumed.

na.omit

Whether missing edges should be counted. Note that missing edge information is not stored.

Details

The update argument controls the contents of the object depending on its mode:

NULL

Use nw's own edgelist, and don't set weights.

character

Use nw's own edgelist, and don't set weights for attribute specified by update.

a list

Use the elements of the list, dropping others.

Value

At this time, a pending_update_network object is (subject to change) a network object with all edges removed and with a network attribute ".update" containing a two or three column matrix with a (possibly valued) edge list. The third column name also indicates the edge attribute represented.

If update uses "newedgelist", it is copied directly; othewirse, "newnwtails", "newnwheads", and (optionally) "newnwweights" are converted to an edgelist.

Its class is set (not subclassed!) to pending_update_network, in order to prevent network accessors and modifiers from affecting it.

Methods (by generic)

  • network.edgecount: Note that this method fails when na.omit=FALSE, since missing edges are not stored.

  • network.dyadcount: Note that this method fails with its default argument, since missing edges are not stored.

  • network.naedgecount: A stub that produces an error.


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.