get_middle_nodes {rsemmed} | R Documentation |
For each pair of source and target nodes in object
, obtain the
names of middle nodes on paths.
get_middle_nodes(graph, object, collapse = TRUE)
graph |
The SemMed graph |
object |
A vertex sequence ( |
collapse |
If |
A tbl
where each row corresponds to a source-target pair
in object
. The last column is a list-column containing character
vectors of names of middle nodes.
data(g_mini) node_cortisol <- find_nodes(g_mini, "Serum cortisol") node_stress <- find_nodes(g_mini, "Chronic Stress") paths <- find_paths(g_mini, from = node_cortisol, to = node_stress) middle <- get_middle_nodes(g_mini, paths)