hg_get() is the single reader of the package. Every object a
constructor or a verb returns – a hypergraph, a memory network, a
simplicial complex, an inference or a community result – hands over its
tables through hg_get(), never through $. what = selects the table;
what = NULL (the default) returns the object's primary table. Filters,
orderings and top = are named arguments of the method for that class.
Usage
hg_get(x, what = NULL, ...)
# Default S3 method
hg_get(x, what = NULL, ...)
# S3 method for class 'net_hg_pairwise'
hg_get(x, what = c("edges", "nodes"), ..., sort_by = NULL, top = NULL)Arguments
- x
A hypergraphs object.
- what
NULL(default) for the object's primary table, or the name of one of its tables (see Tables by class).- ...
Arguments of the method for
class(x): filters (order_min,min_count,dim,k,dimension,significant, ...),sort_by, andtop(the firsttoprows, applied last).- sort_by
Ordering supported by the selected object's method.
- top
Number of rows to return, applied after filters and ordering as described by the selected object's method.
Value
A base data.frame, one row per observation of the selected
table. An object of a class without a method raises
hypergraphs_bad_input, naming the class.
Tables by class
net_hg(hypergraphs)"edges"(default),"nodes","memberships","sets","state_counts","edge_data"; seehg_get.net_hg().text_hypergraph"weights"(default),"documents","vocabulary","sentences"; seehg_get.text_hypergraph().hg_hypergatPredictions (default), evaluation, document text, history and optional attention; see
hg_get.hg_hypergat().net_temporal_hypergraph"memberships"(default),"edges","nodes".net_hon(hon())"rules"(default),"nodes","pathways".net_honem(honem())"embeddings"(default),"variance".net_hypa(hypa()on sequences)"scores"(default),"over","under","pathways".net_mogen(mogen())"orders"(default),"transitions","paths","pathways".net_markov_order(markov_order())"orders"(default),"null".net_path_dependence(memory())"contexts".net_markov_stability(hg_markov_stability())"states"(default),"passage_time","stationary".hypergraphs_bootstrap(hg_bootstrap())"edges".hypergraphs_comparison(hg_compare())"edges".hypergraphs_memory_communities(hg_communities()on a memory network)"states"(default),"physical","modules","codelength","trials".simplicial_complex(simplicial())"simplices"(default),"f_vector","degree".q_analysis(hg_qanalysis())"q_levels"(default),"nodes".persistent_homology(hg_homology())"persistence"(default),"betti".persistence_landscape(hg_landscape())"landscape".hg_communities(hg_communities()on a hypergraph)hypergraphs_community_comparison,hypergraphs_motifs,net_hg_mmsbmsee their methods.
Examples
hg <- window_hypergraph(list(s1 = c("a", "b", "a", "c")), window = 2L)
hg_get(hg)
#> hyperedge size members weight
#> 1 h1 2 a, b 2
#> 2 h2 2 a, c 1
hg_get(hg, what = "nodes")
#> node degree
#> 1 a 2
#> 2 b 1
#> 3 c 1
seqs <- list(c("a", "b", "c", "a", "b", "c"), c("x", "b", "d", "x", "b", "d"))
hg_get(hon(seqs, max_order = 2), what = "nodes")
#> id node
#> 1 1 a
#> 2 2 b
#> 3 3 c
#> 4 4 d
#> 5 5 x