rescale_node_coordinates: Rescale nodes in a ggraph tree for even distribution

Description Usage Arguments Value Examples

View source: R/plotting.R

Description

Takes as input a ggraph object containing a tree graph with 1 or more source nodes at the root connecting to targets in the leaf nodes with connecting ligands and receptors as intermediates. Rescales the X-coordinates of the nodes to ensure an even spacing. Rescales according to a reference row - ligands by default, but probably works best when specified as the row with largets number of nodes. Can select rows to rescale, though all are done by default.

Usage

1
2
3
4
5
rescale_node_coordinates(
  graph,
  scale.by = "Ligand",
  do.update = c("Source", "Ligand", "Receptor", "Target")
)

Arguments

graph

a ggraph object containing a tree graph.

scale.by

a reference row to scale to. Ligand by default.

do.update

select graph rows to updates. All by default.

Value

a ggraph object with node X-coordinates rescaled.

Examples

1
2
3
4
## Not run: 
rescale_target_node_coordinates(tree.graph)

## End(Not run)

VCCRI/scTalk documentation built on June 5, 2021, 6:35 a.m.