as.data.frame.dynet_path_network: Tidy tables from a temporal path-union network

View source: R/path-visual.R

as.data.frame.dynet_path_networkR Documentation

Tidy tables from a temporal path-union network

Description

Tidy tables from a temporal path-union network

Usage

## S3 method for class 'dynet_path_network'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  what = c("edges", "nodes"),
  ...
)

Arguments

x

A network returned by path_network().

row.names, optional

Ignored.

what

"edges", the default, or "nodes".

...

Ignored.

Value

A plain data.frame. For "edges", one row per hop used by an optimal route, with from, to, weight, first_time, last_time and n_endpoints. For "nodes", one row per reached vertex, with name, arrival_time, latency, n_hops, n_paths and groups. See path_network() for what each column means.

Examples

dn <- dynet(school_contacts)
routes <- paths(dn, from = "Ana")
union_network <- path_network(routes)
as.data.frame(union_network, what = "edges")
as.data.frame(union_network, what = "nodes")

Dynet documentation built on Oct. 7, 2026, 5:08 p.m.