template_network {ergm.ego} | R Documentation |
Construct an Empty “Template” Network Consistent with an Egocentric Sample
Description
Taking an object with ego information, constructs a
network
object with no edges whose vertices have the
attributes of the egos in the dataset, replicating the egos as needed, and
taking into accounts their sampling weights.
Usage
template_network(x, ...)
## S3 method for class 'data.frame'
template_network(x, ...)
## S3 method for class 'egor'
template_network(x, N, scaling = c("round", "sample"), ...)
Arguments
x |
A |
... |
Additional arguments, currently unused. |
N |
The target number of vertices the output network should have. |
scaling |
If
|
Value
A network
object.
Methods (by class)
-
template_network(data.frame)
: method fordata.frame
s andtibble
s, specifying ego composition directly. -
template_network(egor)
: method foregor
objects; weights, if any, are obtained from theegor
's design information.
Author(s)
Pavel N. Krivitsky
See Also
as.egor.network
, which performs the inverse
operation.
Examples
data(faux.mesa.high)
summary(faux.mesa.high, print.adj = FALSE)
fmh.ego <- as.egor(faux.mesa.high)
# Same actor attributes
fmh.template <- template_network(fmh.ego, N=network.size(faux.mesa.high))
summary(fmh.template, print.adj = FALSE)
# Twice the actors, same distribution
fmh2.template <- template_network(fmh.ego, N=2*network.size(faux.mesa.high))
summary(fmh2.template, print.adj = FALSE)