fortify.igraph: Fortify method for networks of class 'igraph'

View source: R/fortify-igraph.R

fortify.igraphR Documentation

Fortify method for networks of class igraph

Description

Fortify method for networks of class igraph

Usage

## S3 method for class 'igraph'
fortify(
  model,
  data = NULL,
  layout = igraph::nicely(),
  arrow.gap = ifelse(igraph::is.directed(model), 0.025, 0),
  by = NULL,
  scale = TRUE,
  stringsAsFactors = getOption("stringsAsFactors", FALSE),
  ...
)

Arguments

model

an object of class igraph.

data

not used by this method.

layout

a function call to an igraph layout function, such as layout_nicely (the default), or a 2 column matrix giving the x and y coordinates for the vertices. See layout_ for details.

arrow.gap

a parameter that will shorten the network edges in order to avoid overplotting edge arrows and nodes; defaults to 0 when the network is undirected (no edge shortening), or to 0.025 when the network is directed. Small values near 0.025 will generally achieve good results when the size of the nodes is reasonably small.

by

a character vector that matches an edge attribute, which will be used to generate a data frame that can be plotted with facet_wrap or facet_grid. The nodes of the network will appear in all facets, at the same coordinates. Defaults to NULL (no faceting).

scale

whether to (re)scale the layout coordinates. Defaults to TRUE, but should be set to FALSE if layout contains meaningful spatial coordinates, such as latitude and longitude.

stringsAsFactors

whether vertex and edge attributes should be converted to factors if they are of class character. Defaults to the value of getOption("stringsAsFactors"), which is FALSE by default: see data.frame.

...

additional parameters for the layout_ function

Value

a data.frame object.


ggnetwork documentation built on May 29, 2024, 1:32 a.m.