| as.data.frame.dynet_collapsed_list | R Documentation |
Stacks the per-session edge tables into one tidy frame with a session
key, so a session-separated collapse reads like every other verb's result.
Without this the base method flattened the list sideways into a single row
of s1.from, s2.from, ... columns.
## S3 method for class 'dynet_collapsed_list'
as.data.frame(x, row.names = NULL, optional = FALSE, session = NULL, ...)
x |
A |
row.names |
Ignored; present for compatibility with the generic. |
optional |
Ignored; present for compatibility with the generic. |
session |
Optional session name. Supply one to get that session's
table alone, without the |
... |
Ignored. |
A plain data.frame, one row per collapsed pair per session, with
session first and then the columns
as.data.frame.dynet_collapsed() returns.
dn <- dynet(data.frame(
from = c("A", "A"), to = c("B", "B"), start = c(0, 0), end = c(2, 3),
session = c("s1", "s2")
), session = "session")
by_session <- collapse_network(dn, sessions = "separate")
as.data.frame(by_session)
as.data.frame(by_session, session = "s1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.