build_network.cranly_db: Compute edges and nodes of package directives and...

View source: R/build_network.R

build_network.cranly_dbR Documentation

Compute edges and nodes of package directives and collaboration networks

Description

Compute edges and nodes of package directives and collaboration networks

Usage

## S3 method for class 'cranly_db'
build_network(object, trace = FALSE, perspective = "package", ...)

Arguments

object

a cranly_db object. If missing (default) a call to clean_CRAN_db() is issued.

trace

logical. Print progress information? Default is FALSE.

perspective

character. Should a "package" (default) or an "author" network be built?

...

Other arguments passed in clean_CRAN_db() when object is NULL.

Details

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. The author collaboration network is analyzed and visualized as undirected by all methods in cranly.

Value

A list of 2 data.frame objects with the edges and nodes of the network.

See Also

clean_CRAN_db() subset.cranly_network() plot.cranly_network() extractor-functions

Examples


cran_db <- clean_CRAN_db()

## Build package directives network
package_network <- build_network(object = cran_db, perspective = "package")
head(package_network$edges)
head(package_network$nodes)
attr(package_network, "timestamp")
class(package_network)

## Build author collaboration network
author_network <- build_network(object = cran_db, perspective = "author")
head(author_network$edges)
head(author_network$nodes)
attr(author_network, "timestamp")
class(author_network)



cranly documentation built on Aug. 27, 2022, 1:07 a.m.