pipe_trace_paths | R Documentation |
This is a powerful command which allows the user to trace paths from one or more upstream factors to one or more downstream factors. Only links which are part of such paths are displayed.
pipe_trace_paths(
graf,
from = "",
to = "",
length = 4,
remove_links = F,
threads_direction = "none",
field = "source_id",
calculate_robustness = F
)
graf |
A causal map. |
from |
A character vector of factors to start the trace from. |
to |
A character vector of factors to end the trace at. |
length |
The maximum length of the paths to trace. |
remove_links |
If 'TRUE', links that are not part of the traced paths will be removed from the causal map. |
threads_direction |
The direction in which to trace threads. Valid values are '"up"', '"down"', and '"none"'. |
field |
The field to use to identify threads. Valid values are '"source_id"' and '"target_id"'. |
calculate_robustness |
If 'TRUE', the robustness of the traced paths will be calculated. |
A causal map with the traced paths.
graf <- create_causal_map()
# Trace paths from "A" to "C".
paths <- pipe_trace_paths(graf, from = "A", to = "C")
# Trace paths from "A" to "C" with a maximum length of 2.
paths <- pipe_trace_paths(graf, from = "A", to = "C", length = 2)
# Trace paths from "A" to "C" and remove links that are not part of the traced paths.
paths <- pipe_trace_paths(graf, from = "A", to = "C", remove_links = TRUE)
# Trace paths from "A" to "C" in the "up" direction.
paths <- pipe_trace_paths(graf, from = "A", to = "C", threads_direction = "up")
# Trace paths from "A" to "C" using the "source_id" field to identify threads.
paths <- pipe_trace_paths(graf, from = "A", to = "C", field = "source_id")
# Trace paths from "A" to "C" and calculate the robustness of the traced paths.
paths <- pipe_trace_paths(graf, from = "A", to = "C", calculate_robustness = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.