These functions implement logical tests for networks whose ties name a
third node as well as the two nodes each tie runs between.
All is_*() functions return a logical scalar (TRUE or FALSE).
is_cognitive() marks networks TRUE if they are cognitive social
structures, i.e. where the edgelist contains a 'by' column naming the
node that reported each tie, and all of them report on one roster
of nodes.
is_egocentric() marks networks TRUE if the edgelist contains a 'by'
column naming the ego that reported each tie, but each ego reports on
alters of its own.
is_gossip() marks networks TRUE if the edgelist contains an 'about'
column naming the node each tie is about, as where a sender tells a
receiver about a target.
is_cognitive(.data)
is_egocentric(.data)
is_gossip(.data)An object of a {manynet}-consistent class:
adjacency or incidence matrix from {base} R
edgelist data.frame from {base} R or tbl/tbl_df from {tibble}
stocnet stocnet, from the {manynet} package
igraph igraph, from the {igraph} package
network network, from the {network} package
tidygraph tbl_graph, from the {tidygraph} package
A cognitive social structure (Krackhardt 1987) asks each respondent about
every pair of nodes in one roster, so each report is a network
of the same nodes.
An egocentric design instead asks each ego to name alters of its own,
as a name generator does, so the egos' reports share no nodes.
Both record the reporter in a 'by' column.
They are told apart by the network's 'observation' information,
"cognitive" or "egocentric", and where that is not given,
by whether any two reports share a node.
Note that is_egonet() marks something else: a list of networks,
each of one ego and its ties.
A 'by' or 'about' column that holds only NA names no node,
so a network whose other layers hold one is not marked.
A three-dimensional array cannot say what its third dimension holds,
which may be reporters, targets, waves, or layers.
is_cognitive() marks an array TRUE where that dimension could hold one
reporter for each node, and is_egocentric() and is_gossip() do not
mark arrays.
as_stocnet() asks which of these an array holds.
Krackhardt, David. 1987. "Cognitive social structures". Social Networks 9(2): 109-134. doi:10.1016/0378-8733(87)90009-8
Other marks:
mark_format_change,
mark_format_node,
mark_format_tie
is_cognitive(create_filled(3))
#> [1] FALSE
is_egocentric(create_filled(3))
#> [1] FALSE
is_gossip(create_filled(3))
#> [1] FALSE