Learn R Programming

EpiModel (version 2.0.1)

as.data.frame.netdx: Extract Timed Edgelists netdx Objects

Description

This function extracts timed edgelists for objects of class netdx into a data frame using the generic as.data.frame function.

Usage

# S3 method for netdx
as.data.frame(x, row.names = NULL, optional = FALSE, sim, ...)

Arguments

x

An EpiModel object of class netdx.

row.names
sim

The simulation number to output. If not specified, then data from all simulations will be output.

Examples

Run this code
# NOT RUN {
# 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)

# }

Run the code above in your browser using DataLab