Nudge igraph layout by node
Usage
nudge_igraph_node(
g,
nodes = NULL,
x = 0,
y = 0,
nodes_xy = NULL,
use_grep = FALSE,
aspect = 1,
debug = FALSE,
verbose = FALSE,
...
)Arguments
- g
igraphobject that contains layout coordinates stored as graph attribute"layout", for examplegraph_attr(g, "layout").- nodes
charactervector indicating which nodes ingshould be nudged.- x, y
numericvalues indicating the amount to move each node defined bynodes. These values are relative to the x- and y-axis ranges of the layout coordinates, and based uponaspectbelow.- nodes_xy
listalternative to using argumentsnodes,x,y. This argument assumes alistofnumericadjustments toxandy, where thenames(nodes_xy)are node names. For example:nodes_xy=list(APOE=c(x=0.05, y=-0.01), GAPDH=c(x=0.1, y=0.0)however thenumericvector does not need to contain names.
- use_grep
logicalindicating whether to match values innodestoV(g)$nameandV(g)$labelusingjamba::provigrep(), which follows case-insensitivegrep(). Whenuse_grep=FALSEthe values in eitherV(g)$nameorV(g)$labelmust be identical tonodes.- aspect
numericindicating the aspect ratio of the output plot. Any value other thanaspect=1will use the observed x-axis and y-axis range of the layout coordinates. Whenaspect=1then the highest of x-axis and y-axis ranges is used for the relativexandyadjustment. Note thatigraph::plot()does not maintain aspect ratio 1 by default, butjam_igraph()does maintain aspect ratio 1 and is preferred.- debug
logicalindicating whether to plot the layout before and after adjustment, drawing arrows to indicate the movement of particular nodes. This plot is very basic, using base Rplot(), and is only intended as a quick visual review.- verbose
logicalindicating whether to print verbose output.- ...
additional arguments are ignored.
See also
Other jam cnet igraph functions:
adjust_cnet_nodeset(),
adjust_cnet_set_relayout_gene(),
apply_cnet_direction(),
apply_nodeset_spacing(),
get_cnet_nodeset(),
make_cnet_test(),
rotate_igraph_layout()