Package 'kevinbacran'

Title: Degrees of Separation Between CRAN authors
Description: Calculate the shortest path through a graph network between any two authors listed on CRAN. Analagous to the Six Degrees of Kevin Bacon or Erdos Number. Author X collaborates with author Y; author Z collaborates with Y but not X, therefore the distance from X to Z is two.
Authors: Matt Dray [aut, cre]
Maintainer: Matt Dray <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-09-06 05:23:58 UTC
Source: https://github.com/matt-dray/kevinbacran

Help Index


Package-Author Tidygraph From A CRAN Database Snapshot

Description

A tidygraph object of all package-author relationships as captured on 28 February 2019. Extracted using the kevinbacran::kb_combos() function. Intended as an example for testing the other functions in the package.

Usage

data(cran_graph)

Format

A large tbl_graph (16924 nodes, 99568 edges, 10 elements, 5.8 Mb)

Nodes

package authors

Edges

package names

Source

https://cran.r-project.org/


Fetch CRAN Authors And Create Tidygraph

Description

Fetches CRAN package data, cleans author names, creates a tidy tibble of each package-author combination and turns this into a tidygraph object. Nodes are authors and edges are packages they collaborate on.

Usage

kb_combos()

Value

A tidygraph object with classes 'tbl_graph' and 'igraph'.

Examples

## Not run: 
cran_graph <- kb_combos()
print(cran_graph)

## End(Not run)

The Degree Of Separation Between Named Authors

Description

Returns a numeric value that represents the degrees of separation between the two named authors that were provided to kevinbacran::kb_pair(). This value is the number of edges, or packages, required to link those two authors by the shortest route. The value is analagous to the 'Kevin Bacon Number' or 'Erdos Number'.

Usage

kb_distance(pair_graph)

Arguments

pair_graph

A tidygraph object of CRAN authors/packages created with kb_pair()

Value

A single numeric value

Examples

## Not run: 
separation <- kb_distance(pair_graph)
print(separation)

## End(Not run)

Get Author-Package Network For Two Named Authors

Description

Finds one of the possible shortest paths between two named authors from CRAN. This is possible by searching the tidygraph object of all CRAN's package-author relationships created with kevinbacran::kb_combos(). Outputs a tidygraph object that's a subset of the full CRAN tidygraph. This output contains only the named authors and the authors and packages that link them together.

Usage

kb_pair(tidy_graph, name_a, name_b = "Hadley Wickham")

Arguments

tidy_graph

A tidygraph object of CRAN authors/packages created with kb_combos()

name_a

A character string of a CRAN author's name (one of two)

name_b

A character string of a CRAN author's name (two of two)

Value

A tidygraph object with classes 'tbl_graph' and 'igraph'.

Examples

## Not run: 
pair_graph <- kb_pair(cran_graph, "Garrett Grolemund", "Yihui Xie")
print(pair_graph)

## End(Not run)

Simple Plot Of Shortest Distance Between CRAN Authors

Description

Returns a ggplot2 object that represents the degrees of separation between the two named authors that were provided to kevinbacran::kb_pair(). The two named authors are terminal nodes. Intermediate nodes represent intermediate authors that link via edges that represent a package that the authors collaborated on.

Usage

kb_plot(pair_graph)

Arguments

pair_graph

A tidygraph object of CRAN authors/packages created with kb_pair()

Value

A ggraph plot

Examples

## Not run: 
 <- kb_plot(pair_graph)
print(separation)

## End(Not run)