Search code examples
rgraphr-qgraph

R qgraph network graph with varying size of nodes?


I am currently drawing a qgraph (spring) in R, but I wonder if it is possible to vary the size of the nodes in the graph?


Solution

  • the vsize argument should do the trick

    qgraph(data, vsize = 2)
    

    from ?qgraph:

    vsize
    A value indicating the size of the nodes (horizontal if shape is "rectangle". Can also be a vector of length 2 (nodes are scaled to degree) or a size for each node. Defaults to 8*exp(-nNodes/80)+1

    vsize2
    A 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)