Description Usage Arguments Details Value Author(s) Examples
Uses graph_vis
community detection on the input graph and selects a number of variables from each community as representative.
1 | find_repres(graph, ratio = 0.1, weighted = FALSE)
|
graph |
An arbitrary graph object of data in R. |
ratio |
A number between (0, 1) indicating the ratio of variables to be chosen as representative. Defaults to 0.1. |
weighted |
A logical indicating if the number of nodes selected from each community is weighted. Defaults to FALSE. See details for more information. |
The function uses graph_vis
to detect communities of variables in the graph
input. It sorts each community nodes based on their degree and selects an equal number of each based on ratio
parameter.
If weighted
is TRUE it will select different number of nodes from each community based on their sizes.
a vector containing names of representative variables.
Vahid Balazadeh, Elyas Heidari
1 2 3 4 5 6 7 8 | data("NHANES")
## Using \code{\link[muvis]{min_forest}} graph
mf <- min_forest(data = NHANES[1:1000, ], levels = 10)
repres_vars <- find_repres(graph = mf$graph, ratio = .2)
## Using \code{\link[muvis]{ggm}} graph with \code{weighted = TRUE}
gm <- ggm(data = NHANES[1:1000, ], levels = 10)
repres_vars <- find_repres(graph = gm$graph, weighted = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.