Ihave tried converting the qgraph objects to igraph objects, which I think I should be able to further convert to grobs, perhaps using tidygraph, ggraph, GGally, ggnetwork, or similar, but some of the information I would like to convey is lost along the way, and I already have my networks plotted just the way I want using qgraph.
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.
minimumEdges with absolute weights under this value are not shown (but not omitted). Defaults to 0. Can also be set to "sig" to only show significant edges for graph = "cor" and graph = "pcor"). Significance level is controlled by alpha and bonf arguments
maximumqgraph 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).
cutIn weighted graphs, this argument can be used to cut the scaling of edges in width and color saturation. Edges with absolute weights over this value will have the strongest color intensity and become wider the stronger they are, and edges with absolute weights under this value will have the smallest width and become vaguer the weaker the weight. If this is set to 0, no cutoff is used and all edges vary in width and color. Defaults to 0 for graphs with less then 20 nodes. For larger graphs the cut value is automatically chosen to be equal to the maximum of the 75th quantile of absolute edge strengths or the edge strength corresponding to 2n-th edge strength (n being the number of nodes.)
thresholdA numeric value that defaults to 0. Edges with absolute weight that are not above this value are REMOVED from the network. This differs from minimum which simply changes the scaling of width and color so that edges with absolute weight under minimum are not plotted/invisible. Setting a threshold influences the spring layout and centrality measures obtained with the graph whereass setting a minimum does not. In the case of correlation (graph = "cor") or partial correlation (graph = "pcor") networks this argument can also be given a string to omit insignificant edges. See description of this argumet in the next section (Additional options for correlation/covariance matrices).
themeThis argument sets different defaults for various graphical arguments (most notably posCol, negCol and palette). Can be "classic", "colorblind", "gray", "Hollywood", "Borkulo", "gimme", "TeamFortress", "Reddit", "Leuven" or "Fried".
Type of graph to be made when a correlation or covariance matrix is used as input. Setting this to other values than "default" will check if the matrix is a correlation or covariance matrix; if the matrix is not positive definite nearPD from the Matrix package will be used. Options are:
Outdated and limited supported options are "factorial", which will create a graph based on an exploratory factor analysis, and "sig" will transform all correlations in p-values (using the fdrtool package; Korbinian Strimmer, 2014) and force mode="sig". "sig2" will do the same but show p-values based on negative statistics in shades of orange
thresholdIn addition to a numeric value to omit edges this argument can also be assigned a string to omit insignficant edges. Note that this REMOVES edges from the network (which influences centrality measures and the spring layout). Can be "sig" to compute significance without correction for multiple testing, "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr" or "none" which are used directly in the adjust argument in corr.p of the psych package (Revelle, 2014). In addition, this argument can be assigned "locfdr" in which edges are set to zero if the local FDR is below FDRcutoff. fdrtool from the fdrtool package (Klaus and Strimmer, 2014) is used to compute these measures, which is used inside FDRnetwork.
filetypeA character containing the file type to save the output in. "R" outputs in a new R window, "pdf" creates a pdf file. "svg" creates a svg file (requires RSVGTipsDevice). "tex" creates LaTeX code for the graph (requires tikzDevice). 'jpg', 'tiff' and 'png' can also be used. If this is given any other string (e.g. filetype="") no device is opened. Defaults to 'R' if the current device is the NULL-device or no new device if there already is an open device. A function such as x11 can also be used
normalizeLogical, should the plot be normalized to the plot size. If TRUE (default) border width, vertex size, edge width and arrow sizes are adjusted to look the same for all sizes of the plot, corresponding to what they would look in a 7 by 7 inches plot if normalize is FALSE.
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.
vsize2A value indicating the vertical size of the nodes where the shape is "rectangle". Can also be a vector of length 2 (nodes are scaled to degree) or a size for each node. Defaults to the value of 'vsize'. If 'vsize' is not assigned this value is used as a scalar to 'vsize' (e.g., vsize2 = 1/2 would result in rectangled nodes where the height is half the default width)
shapeA character containing the shape of the nodes. "circle", "square", "triangle" and "diamond" are supported. In addition, can be a name of an element of polygonList to plot the corresponding polygon (not reccomended for large graphs), which by default includes shapes "ellipse" and "heart" Can also be a vector with a shape for each node. Defaults to "circle".
polygonListA list contaning named lists for each element to include polygons to lookup in the shape argument. Each element must be named as they are used in shape and contain a list with elements x and y contaning the coordinates of the polygon. By default ellipse and heart are added to this list. These polygons are scaled according to vsize and vsize2
imagesA character vector of length 1 or the same length as the number of nodes indicating the file location of PNG or JPEG images to use as nodes. Can be NA to not plot an image as node and overwrites 'subplots'
usePCHLogical indicating if nodes should be drawn using polygons or base R plotting symbols. Defaults to TRUE if more than 50 nodes are used in the graph or if the graph is stored in a file. See details.
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.
label.normA single string that is used to normalize label size. If the width of the label is lower than the width of the hypothetical label given by this argument the width of label given by this argument is used instead. Defaults to "OOO" so that every label up to three characters has the same font size.
node.label.offsetA vector of length two with the x and y offset coordinates of the node label (e.g., c(0.5, 0.5) is the default and centers the label with respect to the node area). The vector is passed to the adj argument of graphics::text function.
node.label.positionEither a numeric vector of length 1 (i.e., it gets recycled) or of length equal to the number of nodes in the network, used to set the positions of the node labels. Takes values between 1 and 4 as follows: 1 - bottom; 2 - left; 3 - top; 4 - right. Overrides the node.label.offset argument and values are passed to the pos argument of graphics::text function. Defaults to NULL.
EdgesThese arguments influence the plotting of edges qgraph. Most of them can be assigned a single value, a vector with a value per edge when an edgelist is used as input or a matrix containing values for each edge when a wheights matrix is used as input.
edge.colorColor of edges. Can be either a single value to make all edges the same color, a matrix with a color for each edge (when using a weights matrix) or a vector with a color for each edge (when using an edgelist). NA indicates that the default color should be used. Note that unless fade=FALSE colors still fade to white corresponding to their strength
posColColor of positive edges. Can be a vector of two to indicate color of edges under 'cut' value and color of edges over 'cut' value. If 'fade is set to TRUE the first color will be faded the weaker the edge weight is. If this is only one element this color will also be used for edges stronger than the 'cut' value. Defaults to c("#009900","darkgreen")
negColColor of negative edges. Can be a vector of two to indicate color of edges under 'cut' value and color of edges over 'cut' value. If 'fade is set to TRUE the first color will be faded the weaker the edge weight is. If this is only one element this color will also be used for edges stronger than the 'cut' value. Defaults to c("#BF0000","red")
transIn weighted graphs: logical indicating if the edges should fade to white (FALSE) or become more transparent (TRUE; use this only if you use a background). In directed graphs this is a value between 0 and 1 indicating the level of transparency. (also used as 'transparency')
fadeif TRUE (default) and if 'edge.color' is assigned, transparency will be added to edges that are not transparent (or for which no transparency has been assigned) relative to the edge strength, similar if 'trans' is set to TRUE.
3a8082e126