Tables of a higher-order network
Arguments
- x
A
net_honobject fromhon().- what
"rules"(default) for the extracted higher-order rules,"nodes"for the node table of the higher-order topology, or"pathways"for the genuinely higher-order rules written as pathways ("a b -> c": the context states, then the next state), most frequent first – the formsimplicial()turns into simplices.- ...
For
what = "pathways":min_count,min_prob(drop rules below this count or probability) andorder(keep one context order). Otherwise unused.- order_min
Integer or
NULL. Keep only rules whose source context is at least this order (e.g.2for the genuinely higher-order rules). Only forwhat = "rules".- sort_by
NULL(construction order, default),"count"or"probability"- sort largest first, ties broken byfrom/toso the order is deterministic. Only forwhat = "rules".- top
Integer or
NULL. Return only the firsttoprows, applied after any filter and aftersort_by, sosort_byandtopcompose. DefaultNULLreturns every row.
Value
A data.frame. For what = "rules", one row per rule edge with
columns path, from, to, count, probability, from_order,
to_order. For what = "nodes", one row per higher-order node with
columns id and node. For what = "pathways", one row per
higher-order rule with the column pathway.
Examples
seqs <- list(c("a", "b", "c", "a", "b", "c"), c("x", "b", "d", "x", "b", "d"),
c("a", "b", "c", "a", "b", "c"), c("x", "b", "d", "x", "b", "d"))
net <- hon(seqs, max_order = 2)
hg_get(net, order_min = 2)
#> path from to count probability from_order to_order
#> 1 a -> b -> c a -> b c 4 1 2 1
#> 2 x -> b -> d x -> b d 4 1 2 1
hg_get(net, what = "nodes")
#> id node
#> 1 1 a
#> 2 2 a -> b
#> 3 3 b
#> 4 4 c
#> 5 5 d
#> 6 6 x
#> 7 7 x -> b
hg_get(net, what = "pathways")
#> pathway
#> 1 a b -> c
#> 2 x b -> d