View source: R/as.data.frame.R
as.data.frame.netdx | R Documentation |
This function extracts timed edgelists for objects of class
netdx
into a data frame using the generic
as.data.frame
function.
## S3 method for class 'netdx'
as.data.frame(x, row.names = NULL, optional = FALSE, sim, ...)
x |
An |
row.names |
See |
optional |
See |
sim |
The simulation number to output. If not specified, then data from all simulations will be output. |
... |
See |
A data frame containing the data from x
.
# Initialize and parameterize the network model
nw <- network_initialize(n = 100)
formation <- ~edges
target.stats <- 50
coef.diss <- dissolution_coefs(dissolution = ~offset(edges), duration = 20)
# Model estimation
est <- netest(nw, formation, target.stats, coef.diss, verbose = FALSE)
# Simulate the network with netdx
dx <- netdx(est, nsims = 3, nsteps = 10, keep.tedgelist = TRUE,
verbose = FALSE)
# Extract data from the first simulation
as.data.frame(dx, sim = 1)
# Extract data from all simulations
as.data.frame(dx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.