mark_diff: Marking nodes based on diffusion properties

mark_diffR Documentation

Marking nodes based on diffusion properties

Description

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.

Usage

node_is_latent(.data, time = 0)

node_is_infected(.data, time = 0)

node_is_recovered(.data, time = 0)

node_is_exposed(.data, mark, time = 0)

Arguments

.data

A network object of class mnet, igraph, tbl_graph, network, or similar. For more information on the standard coercion possible, see manynet::as_tidygraph().

time

A time step at which nodes are identified.

mark

vector denoting which nodes are infected

Value

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.

Exposed

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, and '.data' is a diff_model object, then the function will return nodes exposure to the seed nodes in that diffusion.

See Also

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_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, member_brokerage, member_cliques, member_community, member_community_hier, member_community_non, member_components, member_core, member_diffusion, member_equivalence, motif_brokerage_node, motif_exposure, motif_node, motif_path

Other diffusion: measure_diffusion_infection, measure_diffusion_net, measure_diffusion_node, member_diffusion, motif_exposure, motif_hazard

Examples

  # To mark nodes that are latent by a particular time point
  node_is_latent(play_diffusion(create_tree(6), latency = 1), time = 1)
  # To mark nodes that are infected by a particular time point
  node_is_infected(play_diffusion(create_tree(6)), time = 1)
  # To mark nodes that are recovered by a particular time point
  node_is_recovered(play_diffusion(create_tree(6), recovery = 0.5), time = 3)
  # To mark which nodes are currently exposed
  (expos <- node_is_exposed(manynet::create_tree(14), mark = c(1,3)))
  which(expos)

netrics documentation built on July 24, 2026, 5:07 p.m.