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-11-05 04:28:13 UTC |
Source: | https://github.com/matt-dray/kevinbacran |
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.
data(cran_graph)
data(cran_graph)
A large tbl_graph (16924 nodes, 99568 edges, 10 elements, 5.8 Mb)
package authors
package names
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.
kb_combos()
kb_combos()
A tidygraph object with classes 'tbl_graph' and 'igraph'.
## Not run: cran_graph <- kb_combos() print(cran_graph) ## End(Not run)
## Not run: cran_graph <- kb_combos() print(cran_graph) ## End(Not run)
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'.
kb_distance(pair_graph)
kb_distance(pair_graph)
pair_graph |
A tidygraph object of CRAN authors/packages created with
|
A single numeric value
## Not run: separation <- kb_distance(pair_graph) print(separation) ## End(Not run)
## Not run: separation <- kb_distance(pair_graph) print(separation) ## End(Not run)
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.
kb_pair(tidy_graph, name_a, name_b = "Hadley Wickham")
kb_pair(tidy_graph, name_a, name_b = "Hadley Wickham")
tidy_graph |
A tidygraph object of CRAN authors/packages created with
|
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) |
A tidygraph object with classes 'tbl_graph' and 'igraph'.
## Not run: pair_graph <- kb_pair(cran_graph, "Garrett Grolemund", "Yihui Xie") print(pair_graph) ## End(Not run)
## Not run: pair_graph <- kb_pair(cran_graph, "Garrett Grolemund", "Yihui Xie") print(pair_graph) ## End(Not run)
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.
kb_plot(pair_graph)
kb_plot(pair_graph)
pair_graph |
A tidygraph object of CRAN authors/packages created with
|
A ggraph plot
## Not run: <- kb_plot(pair_graph) print(separation) ## End(Not run)
## Not run: <- kb_plot(pair_graph) print(separation) ## End(Not run)