pkgnet: Build a network based on package availability matrix

Description Usage Arguments Details Value See Also Examples

View source: R/pkgnet.R

Description

Given the matrix as returned by available.packages construct a graph, of class igraph of inter-package relations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
pkgnet(object, ...)

## Default S3 method:
pkgnet(object, ...)

## S3 method for class 'character'
pkgnet(object, ap_args = NULL, ...)

## S3 method for class 'matrix'
pkgnet(object, enams = c("Depends", "Suggests", "Imports",
  "Enhances", "LinkingTo"), vnams = c("Version", "Priority", "License",
  "License_is_FOSS", "License_restricts_use", "OS_type", "Archs", "MD5sum",
  "NeedsCompilation", "File", "Repository"), ...)

Arguments

object

a matrix as returned by available.packages or a character scalar, one of "cran" or "bioc" to fetch and process packages available on CRAN or on Bioconductor, or an URL to a CRAN-like repository.

...

arguments passed to/from other methods

ap_args

NULL or list of arguments passed to available.packages

enams

character, names of columns of a that are to be used as edge attributes

vnams

character, names of columns of a that are to be used as vertex attributes

Details

The resulting graph (object of class igraph) is a multigraph: there can be multiple relationships between any given pair of vertices. Different types of relations can be disentagled using edge attribute called type. It stores the type of relation as provided with enams argument.

Value

Object of class igraph.

See Also

available.packages, graph.data.frame

Examples

1
2
3
4
5
6
## Not run: 
a <- available.packages(contrib.url("http://cran.r-project.org", "source"))
g <- pkgnet(a)
summary(g)

## End(Not run)

mbojan/cranet documentation built on May 14, 2019, 4:04 a.m.