Package 'cranet'

Title: Build and Analyze Network of R Packages
Description: Package DESCRIPTION files allows for specifying several types of inter-package relations. These include fields like Depends, Suggests, Enhances etc. This package allows for recovering graph structure based on these relations. Network representation of R repositories enables the user to explore the interconnected space of available R functionality while the developers or repository maintainers can quickly scan package forward and reverse dependencies.
Authors: Michal Bojanowski [aut, cre]
Maintainer: Michal Bojanowski <[email protected]>
License: MIT + file LICENSE
Version: 1.0-0
Built: 2024-10-29 02:45:18 UTC
Source: https://github.com/mbojan/cranet

Help Index


Build and Analyze Network of R Packages

Description

Package DESCRIPTION files allows for specifying several types of inter-package relations. These include fields like Depends, Suggests, Enhances etc. This package and function pkgnet allows for recovering graph structure based on these relations. Network representation of R repositories enables the user to explore the interconnected space of available R functionality while the developers or repository maintainers can quickly scan package forward and reverse dependencies.

Author(s)

Author and maintainter: Michal Bojanowski


Matrix of Available Packages

Description

Snapshot of packages avaiable on CRAN on 2016-08-12

Format

A 8938x17 matrix returned by available.packages with the following column names: “Package”, “Version”, “Priority”, “Depends”, “Imports”, “LinkingTo”, “Suggests”, “Enhances”, “License”, “License_is_FOSS”, “License_restricts_use”, “OS_type”, “Archs”, “MD5sum”, “NeedsCompilation”, “File”, “Repository”.

Source

Fetched from http://cloud.r-project.org on August 12, 2016.

See Also

available.packages, crannet which is an igraph object built from such matrix.


Snapshot of CRAN packages

Description

Snapshot of CRAN packages made on 2016-08-12

Format

The network object is of class igraph. It is a directed network which contains 9182 packages (vertices) and 47032 inter-package relations (edges). The network, together with vertex and edge attributes is build from the matrix as returned by available.packages, which in turn is based on package DESCRIPTION files.

Available edge attributes: type

Available vertex attributes: name, Version, Priority, License, License_is_FOSS, License_restricts_use, OS_type, Archs, MD5sum, NeedsCompilation, File, Repository.

The network is a multi-graph, i.e. there may be multiple edges between a given pair of nodes. This corresponds to the fact, that package X may, for example, both depend and import package Y. To disentangle the types of relations one can use edge attribute type which identifies a type of inter-package relation. Possible values are of this attribute are: Depends, Enhances, Imports, LinkingTo, Suggests. They come from the respective columns in the matrix returned by available.packages.

See available.packages for the description of the attributes and types of inter-package relations.

Source

Fetched from http://cran.at.r-project.org on August 12, 2016.


Build a network based on package availability matrix

Description

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

Usage

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

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

## End(Not run)