quickNet | R Documentation |
This function provide a quick way to plot network graph
quickNet(
data,
layout = "spring",
pie = TRUE,
maximum = 0.47,
groups = NULL,
color = c("#71d0f5", "#fed439", "#66bb6a", "#fd7446", "#d2af81", "#d5e4a2", "#f44336",
"#197ec0", "#46732e", "#8073ac", "#709ae1"),
legend = FALSE,
nodeNames = NULL,
border.width = 2,
border.color = "#555555",
...
)
data |
a data frame, each column presents a node, there should be no miss values in the data frame. |
layout |
This argument controls the layout of the graph. "circle" places all nodes in a single circle, "groups" gives a circular layout in which each group is put in separate circles and "spring" gives a force embedded layout. It also can be a matrix with a row for each node and x and y coordinates in the first and second column respectively. Defaults to "circular" in weighted graphs without a groups list, "groups" in weighted graphs with a groups list, and "spring" in unweighted graphs. Can also be a function from the igraph package. |
pie |
a logical value, specifying whether draw a pie around the node with mgm algorithm. |
maximum |
regards the highest of the maximum or highest absolute edge weight as the highest weight to scale the edge widths too. To compare several graphs, set this argument to a higher value than any edge weight in the graphs (typically 1 for correlations). |
groups |
An object that indicates which nodes belong together. Can be a list in which each element is a vector of integers identifying the numbers of the nodes that belong together, or a factor. |
color |
A vector with a color for each element in the groups list, or a color for each node. Defaults to the background color ("bg" argument, which defaults to "white") without groups list and rainbow(length(groups)) with a groups list. If color is not provided, a set of default colors will be used. |
legend |
Logical value indicating if a legend should be plotted. Defaults to TRUE if a groups object or nodeNames is supplied |
nodeNames |
for each node, can be used to plot a legend next to the plot that links the node labels to node names. |
... |
parameters from |
labels |
If FALSE, no labels are plotted. If TRUE, order in weights matrix is used as labels. This can also be a vector with a label for each node. Defaults for graphs with less than 20 nodes to a 3 character abbreviation of the columnames and rownames if these are identical or else to TRUE. If a label contains an asterisk (e.g. "x1*") then the asterisk will be omitted and the label will be printed in symbol font (use this for Greek letters). Can also be a list with a label as each element, which can be expressions for more advanced mathematical annotation. |
a qgraph object.
data("mtcars")
quickNet(mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.