as.igraph.cranly_network | R Documentation |
cranly_network
to an igraph::graph
objectCoerce a cranly_network
to an igraph::graph
object
## S3 method for class 'cranly_network' as.igraph(x, reverse = FALSE, ...)
x |
a |
reverse |
logical. Should the direction of the edges be reversed? See details. Default is |
... |
currently not used. |
The convention for a cranly_network
object with perspective = "package"
is that the direction of an edge is from the package
that is imported by, suggested by, enhances or is a dependency of
another package, to the latter package. reverse
reverses that
direction to correctly compute relevant network summaries (see
summary.cranly_network
). reverse
is only relevant when the
attr(x, "perspective")
is "package"
and is ignored when
attr(x, "perspective")
is "author"
, in which case the resulting
igraph::graph
object represents an undirected network of
authors.
## Package directives network cran_db <- clean_CRAN_db() package_network <- build_network(cran_db) igraph::as.igraph(package_network) ## Author collaboration network author_network <- build_network(cran_db, perspective = "author") igraph::as.igraph(author_network)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.