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

to_ergm_Cdouble

Methods to serialize objects into numeric vectors for passing to the C side.


Description

These methods return a vector of doubles. For edge lists, this usually takes the form of a 2 e + 1- or 3 e + 1-vector, containing the number of edges followed a column-major serialization of the edgelist matrix.

Usage

## S3 method for class 'network'
to_ergm_Cdouble(x, attrname = NULL, ...)

## S3 method for class 'matrix'
to_ergm_Cdouble(x, prototype = NULL, ...)

## S3 method for class 'rlebdm'
to_ergm_Cdouble(x, ...)

to_ergm_Cdouble(x, ...)

Arguments

x

object to be serialized.

attrname

name of an edge attribute.

...

arguments for methods.

prototype

A network whose relevant attributes (size, directedness, bipartitedness, and presence of loops) are imposed on the output edgelist if x is already an edgelist. (For example, if the prototype is undirected, to_ergm_Cdouble will ensure that t < h.)

Value

The rlebdm method returns a vector with the following:

  • number of nonzero dyads,

  • number of runs of nonzeros,

  • starting positions of the runs, and

  • cumulative lengths of the runs, prepended with 0.

Methods (by class)

  • network: Method for network objects.

  • matrix: Method for matrix objects, assumed to be edgelists.

  • rlebdm: Method for rlebdm objects.


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.