| plot_ism | R Documentation |
Visualizes the Interpretive Structural Model (ISM) as a hierarchical diagram. By default, only essential edges are shown (transitive edges removed) for cleaner visualization suitable for publications.
plot_ism(
reach_matrix,
levels = NULL,
show_transitive = FALSE,
use_igraph = FALSE,
node_labels = NULL,
main = "ISM Hierarchical Structure",
...
)
reach_matrix |
A square reachability matrix (n x n) with 0/1 entries,
typically computed using |
levels |
Optional. An object of class |
show_transitive |
Logical. If |
use_igraph |
Logical. If |
node_labels |
Optional character vector of node labels. If NULL, uses matrix row names or numeric indices. |
main |
Title for the plot. Default is "ISM Hierarchical Structure". |
... |
Additional arguments passed to plotting functions. |
The function performs transitive reduction by default, removing edges that can be inferred from other paths. This produces cleaner diagrams that are more suitable for academic publications and presentations.
Two plotting backends are available:
Base R (default): No additional packages required. Nodes are arranged in horizontal levels with arrows showing relationships.
igraph: Requires the igraph package. Provides more sophisticated graph layouts and styling options.
Invisibly returns a list containing:
levels: the level partitioning result
edges: data frame of edges used in the plot
reduced_matrix: the adjacency matrix after transitive reduction
plot_interactive_ism for interactive visualization,
compute_reachability for computing reachability matrices,
level_partitioning for hierarchical decomposition,
extract_direct_edges for transitive reduction.
# Create adjacency matrix
adj <- matrix(c(0, 1, 0, 0,
0, 0, 1, 1,
0, 0, 0, 0,
0, 0, 0, 0), nrow = 4, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D")
# Compute reachability
reach <- compute_reachability(adj)
# Plot ISM structure (base R, transitive edges removed)
plot_ism(reach)
# Show all edges including transitive ones
plot_ism(reach, show_transitive = TRUE)
# Use igraph if available
plot_ism(reach, use_igraph = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.