as.data.frame.dynet_paths: Tidy data frame of time-respecting paths

View source: R/methods.R

as.data.frame.dynet_pathsR Documentation

Tidy data frame of time-respecting paths

Description

Tidy data frame of time-respecting paths

Usage

## S3 method for class 'dynet_paths'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  what = c("paths", "steps"),
  ...
)

Arguments

x

A dynet_paths.

row.names

Ignored; present for compatibility with the generic.

optional

Ignored; present for compatibility with the generic.

what

"paths", the default, for the endpoint summary, or "steps" for the tidy reconstructed optimal routes. The latter includes endpoint-local path_id values for tied contact sequences.

...

Ignored.

Value

A plain data.frame. For "paths", one row per endpoint vertex, the source included, with the columns paths() documents: node, reachable, arrival_time, attained, latency, n_hops and n_paths, plus path_session and n_best_sessions under sessions = "bounded", and session and origin under sessions = "separate". For "steps", one row per step of every reconstructed optimal route, with endpoint (the vertex the route ends at), path_id (which of the tied optimal routes to that endpoint), path_session, step (position along the route, starting at the source), node (the vertex occupied at that step), time (when it was reached) and attained.

Examples

dn <- dynet(school_contacts)
reach <- paths(dn, from = "Ana")
as.data.frame(reach)
as.data.frame(reach, what = "steps")

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