| as_initial_graph | R Documentation |
Graph objects have different structures and attributes in
graphicalMCP, gMCP, and igraph R packages. These functions convert
between different classes to increase compatibility.
Note that igraph and gMCP have additional attributes for vertices, edges,
or a graph itself. These conversion functions only handle attributes related
to hypothesis names, hypothesis weights and transition weights. Other
attributes will be dropped when converting.
as_initial_graph(graph)
## S3 method for class 'graphMCP'
as_initial_graph(graph)
## S3 method for class 'igraph'
as_initial_graph(graph)
as_graphMCP(graph)
## S3 method for class 'initial_graph'
as_graphMCP(graph)
as_igraph(graph)
## S3 method for class 'initial_graph'
as_igraph(graph)
graph |
An |
as_graphMCP() returns a graphMCP object for the gMCP package.
as_igraph() returns an igraph object for the igraph package.
as_initial_graph() returns an initial_graph object for the
graphicalMCP package.
Csardi, G., Nepusz, T., Traag, V., Horvat, S., Zanini, F., Noom, D., and Mueller, K. (2024). igraph: Network analysis and visualization in R. R package version 2.0.3. https://CRAN.R-project.org/package=igraph.
Rohmeyer, K., and Klinglmueller, K. (2024). gMCP: Graph based multiple test procedures. R package version 0.8-17. https://cran.r-project.org/package=gMCP.
graph_create() for the initial graph used in the graphicalMCP
package.
g_graphicalMCP <- random_graph(5)
if (requireNamespace("gMCP", quietly = TRUE)) {
g_gMCP <- as_graphMCP(g_graphicalMCP)
all.equal(g_graphicalMCP, as_initial_graph(g_gMCP))
}
if (requireNamespace("igraph", quietly = TRUE)) {
g_igraph <- as_igraph(g_graphicalMCP)
all.equal(g_graphicalMCP, as_initial_graph(g_igraph))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.