These functions return logical vectors the length of the nodes in a network identifying which hold certain properties or positions in the network.
node_is_infected() marks nodes that are infected by a particular time point.
node_is_exposed() marks nodes that are exposed to a given (other) mark.
node_is_latent() marks nodes that are latent at a particular time point.
node_is_recovered() marks nodes that are recovered at a particular time point.
node_is_latent(.data, time = 0, attribute = "diffusion")
node_is_infected(.data, time = 0, attribute = "diffusion")
node_is_recovered(.data, time = 0, attribute = "diffusion")
node_is_exposed(.data, mark, time = 0, attribute = "diffusion")A network object of class stocnet, igraph, tbl_graph, network, or similar.
Internally any of these will be coerced to an efficient implementation.
For more information on possible coercions, see e.g. manynet::as_stocnet().
A time step at which nodes are identified.
Name of the nodal attribute that holds the diffusion,
as its start state on the nodes and as its changes.
By default "diffusion", as in play_diffusion().
vector denoting which nodes are infected
A node_mark logical vector the length of the nodes in the network,
giving either TRUE or FALSE for each node depending on
whether the condition is matched.
node_is_exposed() is similar to node_exposure(),
but returns a mark (TRUE/FALSE) vector indicating which nodes
are currently exposed to the diffusion content.
This diffusion content can be expressed in the 'mark' argument.
If no 'mark' argument is provided,
the function marks the nodes exposed at time
to the nodes infected in the diffusion.
Other marks:
mark_core,
mark_degree,
mark_dyads,
mark_nodes,
mark_select_node,
mark_select_tie,
mark_ties,
mark_triangles
Other nodal:
mark_core,
mark_degree,
mark_nodes,
mark_select_node,
measure_accuracy_node,
measure_assort_node,
measure_broker_node,
measure_brokerage,
measure_central_between,
measure_central_close,
measure_central_degree,
measure_central_eigen,
measure_closure_node,
measure_core,
measure_diffusion_node,
measure_diverse_node,
measure_domain,
measure_opinion,
member_brokerage,
member_cliques,
member_community,
member_community_hier,
member_community_modular,
member_community_partition,
member_community_spread,
member_components,
member_core,
member_diffusion,
member_equivalence,
motif_accuracy_node,
motif_brokerage_node,
motif_clique,
motif_composition,
motif_exposure,
motif_node,
motif_path
Other diffusion:
measure_diffusion_infection,
measure_diffusion_net,
measure_diffusion_node,
member_diffusion,
motif_exposure,
motif_hazard
# To mark nodes that are latent by a particular time point
node_is_latent(play_diffusion(create_tree(6), onset = 0), time = 1)
#> V1 V2 V3 V4 V5 V6
#> 1 FALSE TRUE TRUE FALSE FALSE FALSE
# To mark nodes that are infected by a particular time point
node_is_infected(play_diffusion(create_tree(6)), time = 1)
#> V1 V2 V3 V4 V5 V6
#> 1 TRUE TRUE TRUE FALSE FALSE FALSE
# To mark nodes that are recovered by a particular time point
node_is_recovered(play_diffusion(create_tree(6), recovery = 0.5), time = 3)
#> V1 V2 V3 V4 V5 V6
#> 1 TRUE FALSE FALSE FALSE FALSE FALSE
# To mark which nodes are currently exposed
(expos <- node_is_exposed(manynet::create_tree(14), mark = c(1,3)))
#> V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13
#> 1 FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
#> # ... and 1 more values from this nodeset. Use `print_all(...)` to print all values.
which(expos)
#> [1] 2 6 7